2008-06-13 18:37:18 +04:00
###############################################################################
2004-07-03 22:21:13 +04:00
## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
2023-02-13 02:07:01 +03:00
## Copyright (C) 2004-2023 Red Hat, Inc. All rights reserved.
2001-09-21 16:37:43 +04:00
##
2004-07-03 22:21:13 +04:00
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
## of the GNU General Public License v.2.
2001-09-21 16:37:43 +04:00
##
2004-07-03 22:21:13 +04:00
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
2016-01-21 13:49:46 +03:00
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2001-09-21 16:37:43 +04:00
################################################################################
2016-02-18 02:53:35 +03:00
AC_PREREQ(2.69)
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Process this file with autoconf to produce a configure script.
2007-08-14 23:11:31 +04:00
AC_INIT
2017-03-23 04:00:49 +03:00
CONFIGURE_LINE="$0 $@"
2007-08-14 23:11:31 +04:00
AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
2015-09-11 22:30:05 +03:00
AC_CONFIG_HEADERS([include/configure.h])
2006-05-10 01:23:51 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-07-03 22:21:13 +04:00
dnl -- Setup the directory where autoconf has auxilary files
2007-09-18 22:26:32 +04:00
AC_CONFIG_AUX_DIR(autoconf)
2001-09-21 16:37:43 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Get system type
2007-08-14 23:11:31 +04:00
AC_CANONICAL_TARGET([])
2003-04-15 17:24:42 +04:00
2015-05-13 22:30:20 +03:00
AS_IF([test -z "$CFLAGS"], [COPTIMISE_FLAG="-O2"])
2022-11-27 17:35:07 +03:00
AS_CASE(["$host_os"],
[linux*], [
2017-08-01 00:56:58 +03:00
# equivalent to -rdynamic
2011-11-15 01:30:35 +04:00
ELDFLAGS="-Wl,--export-dynamic"
2023-02-22 16:41:08 +03:00
STATIC_LDFLAGS="-Wl,--no-export-dynamic"
2011-11-15 01:30:35 +04:00
# FIXME Generate list and use --dynamic-list=.dlopen.sym
2004-03-26 17:17:14 +03:00
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
2023-02-09 19:37:17 +03:00
LIB_SUFFIX="so"
DEVMAPPER="yes"
ODIRECT="yes"
DM_IOCTLS="yes"
SELINUX="yes"
FSADM="yes"
LVMIMPORTVDO="yes"
BLKDEACTIVATE="yes"],
2022-11-27 17:35:07 +03:00
[darwin*], [
2004-06-28 18:01:24 +04:00
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
2011-11-15 01:30:35 +04:00
ELDFLAGS=
2004-03-26 17:17:14 +03:00
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
2023-02-09 19:37:17 +03:00
LIB_SUFFIX="dylib"
DEVMAPPER="yes"
ODIRECT="no"
DM_IOCTLS="no"
SELINUX="no"
FSADM="no"
LVMIMPORTVDO="no"
BLKDEACTIVATE="no"],
2022-11-27 17:35:07 +03:00
[CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"])
2003-04-15 17:24:42 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Checks for programs.
2009-08-14 00:23:01 +04:00
AC_PROG_SED
2004-06-29 17:29:25 +04:00
AC_PROG_AWK
2015-05-13 22:23:24 +03:00
save_CFLAGS=$CFLAGS
save_CXXFLAGS=$CXXFLAGS
2004-06-29 17:29:25 +04:00
AC_PROG_CC
2014-06-08 20:23:47 +04:00
AC_PROG_CXX
2015-05-13 22:23:24 +03:00
CFLAGS=$save_CFLAGS
CXXFLAGS=$save_CXXFLAGS
2018-01-29 18:20:53 +03:00
PATH_SBIN="$PATH:/usr/sbin:/sbin"
2008-06-13 18:37:18 +04:00
dnl probably no longer needed in 2008, but...
AC_PROG_GCC_TRADITIONAL
2004-06-29 17:29:25 +04:00
AC_PROG_INSTALL
AC_PROG_LN_S
2024-03-20 18:14:54 +03:00
AC_PROG_GREP
AC_PROG_EGREP
2004-06-29 17:29:25 +04:00
AC_PROG_MAKE_SET
2009-08-14 00:23:01 +04:00
AC_PROG_MKDIR_P
2008-06-27 23:24:17 +04:00
AC_PROG_RANLIB
2022-11-19 19:51:08 +03:00
AC_CHECK_TOOL([READELF], [readelf])
2017-04-13 10:07:49 +03:00
AC_CHECK_TOOL(AR, ar)
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(CFLOW_CMD, cflow)
AC_PATH_TOOL(CSCOPE_CMD, cscope)
2016-02-18 02:53:35 +03:00
AC_PATH_TOOL(CHMOD, chmod)
2017-02-11 01:20:19 +03:00
AC_PATH_TOOL(WC, wc)
AC_PATH_TOOL(SORT, sort)
2004-06-29 17:29:25 +04:00
################################################################################
2008-06-13 18:37:18 +04:00
dnl -- Check for header files.
2004-06-28 18:01:24 +04:00
AC_HEADER_DIRENT
2010-07-06 02:23:15 +04:00
AC_HEADER_MAJOR
2015-07-27 16:26:56 +03:00
AC_HEADER_STDBOOL
2004-07-03 22:21:13 +04:00
2015-07-27 16:26:56 +03:00
AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h \
2021-04-10 23:09:32 +03:00
getopt.h inttypes.h langinfo.h libgen.h limits.h locale.h paths.h \
2015-07-27 16:26:56 +03:00
signal.h stdarg.h stddef.h stdio.h stdlib.h string.h sys/file.h \
sys/ioctl.h syslog.h sys/mman.h sys/param.h sys/resource.h sys/stat.h \
sys/time.h sys/types.h sys/utsname.h sys/wait.h time.h \
unistd.h], , [AC_MSG_ERROR(bailing out)])
2017-03-23 04:00:49 +03:00
AC_CHECK_HEADERS(termios.h sys/statvfs.h sys/timerfd.h sys/vfs.h linux/magic.h linux/fiemap.h)
2021-04-10 23:09:32 +03:00
AC_CHECK_HEADERS(libaio.h,LVM_NEEDS_LIBAIO_WARN=,LVM_NEEDS_LIBAIO_WARN=y)
2022-11-27 17:35:07 +03:00
AS_CASE(["$host_os"],
[linux*], [AC_CHECK_HEADERS([asm/byteorder.h linux/fs.h malloc.h], [], [AC_MSG_ERROR(bailing out)])],
[darwin*], [AC_CHECK_HEADERS([machine/endian.h sys/disk.h], [], [AC_MSG_ERROR(bailing out)])])
2004-06-28 18:01:24 +04:00
################################################################################
2008-06-13 18:37:18 +04:00
dnl -- Check for typedefs, structures, and compiler characteristics.
2004-06-28 18:01:24 +04:00
AC_C_CONST
AC_C_INLINE
2008-06-13 18:37:18 +04:00
AC_CHECK_MEMBERS([struct stat.st_rdev])
2015-07-27 16:26:56 +03:00
AC_CHECK_TYPES([ptrdiff_t])
2017-03-23 04:00:49 +03:00
AC_STRUCT_ST_BLOCKS
2015-07-27 16:26:56 +03:00
AC_STRUCT_TM
2004-06-28 18:01:24 +04:00
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
2004-07-03 22:21:13 +04:00
AC_TYPE_MODE_T
2010-07-06 02:23:15 +04:00
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
2016-12-12 15:03:16 +03:00
AX_GCC_BUILTIN([__builtin_clz])
2018-06-19 20:35:48 +03:00
AX_GCC_BUILTIN([__builtin_clzll])
2021-09-24 19:04:39 +03:00
AX_GCC_BUILTIN([__builtin_ffs])
2004-07-03 22:21:13 +04:00
2018-12-03 20:14:26 +03:00
AC_DEFINE([_GNU_SOURCE], 1, [Define to get access to GNU/Linux extension])
AC_DEFINE([_REENTRANT], 1, [Define to use re-entrant thread safe versions])
2004-07-03 22:21:13 +04:00
################################################################################
dnl -- Check for functions
2015-07-27 16:26:56 +03:00
AC_CHECK_FUNCS([ftruncate gethostname getpagesize gettimeofday localtime_r \
2019-08-26 18:34:45 +03:00
memchr memset mkdir mkfifo munmap nl_langinfo pselect realpath rmdir setenv \
2015-07-27 16:26:56 +03:00
setlocale strcasecmp strchr strcspn strdup strerror strncasecmp strndup \
strrchr strspn strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
2022-08-30 14:28:24 +03:00
AC_CHECK_FUNCS([ffs mallinfo2 prlimit versionsort])
2004-07-03 22:21:13 +04:00
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
2010-07-06 02:23:15 +04:00
AC_FUNC_CHOWN
2004-07-03 22:21:13 +04:00
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
2015-07-27 16:26:56 +03:00
AC_FUNC_MKTIME
2004-07-03 22:21:13 +04:00
AC_FUNC_MMAP
2010-07-06 02:23:15 +04:00
AC_FUNC_REALLOC
2004-07-03 22:21:13 +04:00
AC_FUNC_STAT
AC_FUNC_STRTOD
2008-06-13 18:37:18 +04:00
AC_FUNC_VPRINTF
2004-06-28 18:01:24 +04:00
2015-09-07 14:57:38 +03:00
################################################################################
dnl -- Disable dependency tracking
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable dependency tracking])
2015-09-07 14:57:38 +03:00
AC_ARG_ENABLE(dependency-tracking,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-dependency-tracking],
2015-09-07 14:57:38 +03:00
[speeds up one-time build.]),
2023-02-09 19:37:17 +03:00
USE_TRACKING=$enableval, USE_TRACKING="yes")
AC_MSG_RESULT([$USE_TRACKING])
2015-09-07 14:57:38 +03:00
2018-06-23 00:30:42 +03:00
################################################################################
dnl -- Disable silence rules
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build silently])
2018-06-23 00:30:42 +03:00
AC_ARG_ENABLE(silent-rules,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-silent-rules], [disable silent building]),
2023-02-09 19:37:17 +03:00
SILENT_RULES=$enableval, SILENT_RULES="yes")
AC_MSG_RESULT([$SILENT_RULES])
2018-06-23 00:30:42 +03:00
2009-01-20 20:07:53 +03:00
################################################################################
dnl -- Enables statically-linked tools
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to use static linking])
2009-01-20 20:07:53 +03:00
AC_ARG_ENABLE(static_link,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-static_link],
2010-07-08 16:02:48 +04:00
[use this to link the tools to their libraries
statically (default is dynamic linking]),
2023-02-09 19:37:17 +03:00
STATIC_LINK=$enableval, STATIC_LINK="no")
AC_MSG_RESULT([$STATIC_LINK])
2009-01-20 20:07:53 +03:00
2023-09-22 09:47:38 +03:00
################################################################################
dnl -- Disables shared linking
AC_MSG_CHECKING([whether to use dynamic linking])
AC_ARG_ENABLE(shared,
AS_HELP_STRING([--disable-shared], [disable dynamic linking]),
SHARED_LINK=$enableval, SHARED_LINK="yes")
AC_MSG_RESULT([$SHARED_LINK])
2013-12-04 12:58:58 +04:00
################################################################################
dnl -- Check if compiler/linker supports PIE and RELRO
AC_TRY_CCFLAG([-pie], [HAVE_PIE], [], [])
AC_SUBST(HAVE_PIE)
AC_TRY_LDFLAGS([-Wl,-z,relro,-z,now], [HAVE_FULL_RELRO], [], [])
AC_SUBST(HAVE_FULL_RELRO)
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Prefix is /usr by default, the exec_prefix default is setup later
2001-09-21 16:37:43 +04:00
AC_PREFIX_DEFAULT(/usr)
2017-10-25 17:49:17 +03:00
################################################################################
dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
2022-11-27 17:35:05 +03:00
test "$exec_prefix" = "NONE" && test "$prefix" = "NONE" && exec_prefix=""
2017-10-25 17:49:17 +03:00
2023-02-09 19:37:17 +03:00
test "$prefix" = "NONE" && prefix=$ac_default_prefix
2017-10-25 17:49:17 +03:00
# Let make expand exec_prefix.
2023-02-09 19:37:17 +03:00
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
2017-10-25 17:49:17 +03:00
2023-10-12 20:19:01 +03:00
AC_ARG_WITH(blkid, [AS_HELP_STRING([--without-blkid], [do not build with blkid library])],
[], with_blkid="yes")
AC_ARG_WITH(systemd, [AS_HELP_STRING([--without-systemd], [do not build with systemd library])],
[], with_systemd="yes")
AC_ARG_WITH(udev, [AS_HELP_STRING([--without-udev], [do not build with udev library])],
[], with_udev="yes")
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Setup the ownership of the files
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([file owner])
2001-09-21 16:37:43 +04:00
AC_ARG_WITH(user,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-user=USER],
2014-10-30 19:13:05 +03:00
[set the owner of installed files [USER=]]),
2010-07-08 16:02:48 +04:00
OWNER=$withval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$OWNER])
2014-06-05 19:28:03 +04:00
test -n "$OWNER" && INSTALL="$INSTALL -o $OWNER"
2001-09-21 16:37:43 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Setup the group ownership of the files
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([group owner])
2001-09-21 16:37:43 +04:00
AC_ARG_WITH(group,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-group=GROUP],
2014-10-30 19:13:05 +03:00
[set the group owner of installed files [GROUP=]]),
2010-07-08 16:02:48 +04:00
GROUP=$withval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$GROUP])
2014-06-05 19:28:03 +04:00
test -n "$GROUP" && INSTALL="$INSTALL -g $GROUP"
2001-09-21 16:37:43 +04:00
2008-11-01 05:19:19 +03:00
################################################################################
dnl -- Setup device node ownership
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([device node uid])
2008-11-01 05:19:19 +03:00
AC_ARG_WITH(device-uid,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-device-uid=UID],
2014-10-30 19:13:05 +03:00
[set the owner used for new device nodes [UID=0]]),
2010-07-08 16:02:48 +04:00
DM_DEVICE_UID=$withval, DM_DEVICE_UID=0)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$DM_DEVICE_UID])
2015-05-18 11:36:11 +03:00
AC_DEFINE_UNQUOTED([DM_DEVICE_UID], [$DM_DEVICE_UID], [Define default owner for device node])
2008-11-01 05:19:19 +03:00
################################################################################
dnl -- Setup device group ownership
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([device node gid])
2008-11-01 05:19:19 +03:00
AC_ARG_WITH(device-gid,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-device-gid=GID],
2014-10-30 19:13:05 +03:00
[set the group used for new device nodes [GID=0]]),
2010-07-08 16:02:48 +04:00
DM_DEVICE_GID=$withval, DM_DEVICE_GID=0)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$DM_DEVICE_GID])
2015-05-18 11:36:11 +03:00
AC_DEFINE_UNQUOTED([DM_DEVICE_GID], [$DM_DEVICE_GID], [Define default group for device node])
2008-11-01 05:19:19 +03:00
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Setup device mode
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([device node mode])
2008-11-01 01:06:09 +03:00
AC_ARG_WITH(device-mode,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-device-mode=MODE],
2014-10-30 19:13:05 +03:00
[set the mode used for new device nodes [MODE=0600]]),
2010-07-08 16:02:48 +04:00
DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$DM_DEVICE_MODE])
2015-05-18 11:36:11 +03:00
AC_DEFINE_UNQUOTED([DM_DEVICE_MODE], [$DM_DEVICE_MODE], [Define default mode for device node])
2008-11-01 01:06:09 +03:00
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([when to create device nodes])
2011-02-05 01:17:54 +03:00
AC_ARG_WITH(device-nodes-on,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-device-nodes-on=ON],
2014-10-30 19:13:05 +03:00
[create nodes on resume or create [ON=resume]]),
2011-02-05 01:17:54 +03:00
ADD_NODE=$withval, ADD_NODE=resume)
2022-11-27 17:35:07 +03:00
AS_CASE(["$ADD_NODE"],
[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])])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([on $ADD_NODE])
2011-02-05 01:17:54 +03:00
AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
2021-10-14 23:36:33 +03:00
dnl -- Default settings for lvm.conf { devices/use_devicesfile }
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([default for use_devicesfile])
2021-10-14 23:36:33 +03:00
AC_ARG_WITH(default-use-devices-file,
2024-04-09 15:50:52 +03:00
AS_HELP_STRING([--with-default-use-devices-file=ON], [default lvm.conf devices/use_devicesfile = [ON=0]]),
2021-10-16 00:33:59 +03:00
DEFAULT_USE_DEVICES_FILE=$withval, DEFAULT_USE_DEVICES_FILE=0)
2022-11-27 17:35:07 +03:00
AS_CASE(["$DEFAULT_USE_DEVICES_FILE"],
[0|1], [],
[AC_MSG_ERROR([--with-default-use-devices-file parameter invalid])])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$DEFAULT_USE_DEVICES_FILE])
2021-10-14 23:36:33 +03:00
AC_DEFINE_UNQUOTED(DEFAULT_USE_DEVICES_FILE, [$DEFAULT_USE_DEVICES_FILE],
2022-08-09 17:01:34 +03:00
[Default for lvm.conf use_devicesfile.])
2021-10-14 23:36:33 +03:00
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([default name mangling])
2012-02-15 15:17:57 +04:00
AC_ARG_WITH(default-name-mangling,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-name-mangling=MANGLING],
2014-10-30 19:13:05 +03:00
[default name mangling: auto/none/hex [auto]]),
2012-02-15 15:17:57 +04:00
MANGLING=$withval, MANGLING=auto)
2022-11-27 17:35:07 +03:00
AS_CASE(["$MANGLING"],
[auto], [mangling=DM_STRING_MANGLING_AUTO],
[no|none|disabled], [mangling=DM_STRING_MANGLING_NONE],
[hex], [mangling=DM_STRING_MANGLING_HEX],
[AC_MSG_ERROR([--with-default-name-mangling parameter invalid])])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$MANGLING])
2012-02-15 15:17:57 +04:00
AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
2024-04-09 15:50:52 +03:00
AC_MSG_CHECKING([default for event_activation])
AC_ARG_WITH(default-event-activation,
AS_HELP_STRING([--with-default-event-activation=ON], [default lvm.conf global/event_activation = [ON=1]]),
DEFAULT_EVENT_ACTIVATION=$withval, DEFAULT_EVENT_ACTIVATION=1)
AS_CASE(["$DEFAULT_EVENT_ACTIVATION"],
[0|1], [],
[AC_MSG_ERROR([--with-default-event-activation parameter invalid])])
AC_MSG_RESULT([$DEFAULT_EVENT_ACTIVATION])
AC_DEFINE_UNQUOTED(DEFAULT_EVENT_ACTIVATION, [$DEFAULT_EVENT_ACTIVATION],
[Default for lvm.conf event_activation.])
2004-06-28 18:01:24 +04:00
################################################################################
2004-05-05 01:25:57 +04:00
dnl -- snapshots inclusion type
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include snapshots])
2004-05-05 01:25:57 +04:00
AC_ARG_WITH(snapshots,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-snapshots=TYPE],
2021-04-08 22:29:44 +03:00
[snapshot support: internal/none [internal]]),
2010-07-08 16:02:48 +04:00
SNAPSHOTS=$withval, SNAPSHOTS=internal)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$SNAPSHOTS])
2004-05-05 01:25:57 +04:00
2022-11-27 17:35:07 +03:00
AS_CASE(["$SNAPSHOTS"],
[no|none|shared], [],
[internal], [
AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])],
[AC_MSG_ERROR([--with-snapshots parameter invalid])])
2004-05-05 01:25:57 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-05-05 01:25:57 +04:00
dnl -- mirrors inclusion type
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include mirrors])
2004-05-05 01:25:57 +04:00
AC_ARG_WITH(mirrors,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-mirrors=TYPE],
2021-04-08 22:29:44 +03:00
[mirror support: internal/none [internal]]),
2010-07-08 16:02:48 +04:00
MIRRORS=$withval, MIRRORS=internal)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$MIRRORS])
2004-05-05 01:25:57 +04:00
2022-11-27 17:35:07 +03:00
AS_CASE(["$MIRRORS"],
[no|none|shared], [],
[internal], [
AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])],
[AC_MSG_ERROR([--with-mirrors parameter invalid])])
2004-05-05 01:25:57 +04:00
2011-08-03 02:07:20 +04:00
################################################################################
dnl -- raid inclusion type
2014-10-31 01:38:02 +03:00
AC_ARG_WITH(default-mirror-segtype,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-mirror-segtype=TYPE],
2014-10-31 01:38:02 +03:00
[default mirror segtype: raid1/mirror [raid1]]),
DEFAULT_MIRROR_SEGTYPE=$withval, DEFAULT_MIRROR_SEGTYPE="raid1")
2015-02-19 18:17:19 +03:00
AC_ARG_WITH(default-raid10-segtype,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-raid10-segtype=TYPE],
2014-10-31 01:38:02 +03:00
[default mirror segtype: raid10/mirror [raid10]]),
DEFAULT_RAID10_SEGTYPE=$withval, DEFAULT_RAID10_SEGTYPE="raid10")
2018-05-03 16:21:21 +03:00
AC_DEFINE([RAID_INTERNAL], 1,
2018-05-03 17:38:05 +03:00
[Define to 1 to include built-in support for raid.])
2011-08-03 02:07:20 +04:00
2014-10-31 01:38:02 +03:00
AC_DEFINE_UNQUOTED([DEFAULT_MIRROR_SEGTYPE], ["$DEFAULT_MIRROR_SEGTYPE"],
[Default segtype used for mirror volumes.])
AC_DEFINE_UNQUOTED([DEFAULT_RAID10_SEGTYPE], ["$DEFAULT_RAID10_SEGTYPE"],
[Default segtype used for raid10 volumes.])
2010-05-21 16:36:30 +04:00
################################################################################
2014-10-31 01:38:02 +03:00
AC_ARG_WITH(default-sparse-segtype,
2022-11-27 17:35:07 +03:00
AS_HELP_STRING([--with-default-sparse-segtype=TYPE], [default sparse segtype: thin/snapshot [thin]]), [
AS_CASE(["$withval"],
[thin|snapshot], [DEFAULT_SPARSE_SEGTYPE=$withval],
[AC_MSG_ERROR([--with-default-sparse-segtype parameter invalid])])
], [DEFAULT_SPARSE_SEGTYPE="thin"])
2014-10-31 01:38:02 +03:00
2011-08-24 12:27:49 +04:00
################################################################################
dnl -- thin provisioning
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include thin provisioning])
2011-08-24 12:27:49 +04:00
AC_ARG_WITH(thin,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-thin=TYPE],
2021-04-08 22:29:44 +03:00
[thin provisioning support: internal/none [internal]]),
2013-12-12 16:07:59 +04:00
THIN=$withval, THIN=internal)
AC_ARG_WITH(thin-check,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-thin-check=PATH],
2014-10-30 19:13:05 +03:00
[thin_check tool: [autodetect]]),
2013-12-12 17:29:15 +04:00
THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
2013-12-12 16:07:59 +04:00
AC_ARG_WITH(thin-dump,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-thin-dump=PATH],
2014-10-30 19:13:05 +03:00
[thin_dump tool: [autodetect]]),
2013-12-12 17:29:15 +04:00
THIN_DUMP_CMD=$withval, THIN_DUMP_CMD="autodetect")
2013-12-12 16:07:59 +04:00
AC_ARG_WITH(thin-repair,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-thin-repair=PATH],
2014-10-30 19:13:05 +03:00
[thin_repair tool: [autodetect]]),
2013-12-12 17:29:15 +04:00
THIN_REPAIR_CMD=$withval, THIN_REPAIR_CMD="autodetect")
2014-05-27 01:28:03 +04:00
AC_ARG_WITH(thin-restore,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-thin-restore=PATH],
2014-10-30 19:13:05 +03:00
[thin_restore tool: [autodetect]]),
2014-05-27 01:28:03 +04:00
THIN_RESTORE_CMD=$withval, THIN_RESTORE_CMD="autodetect")
2013-12-12 16:07:59 +04:00
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$THIN])
2011-08-24 12:27:49 +04:00
2022-11-27 17:35:07 +03:00
AS_CASE(["$THIN"],
[no|none], [test "$DEFAULT_SPARSE_SEGTYPE" = "thin" && DEFAULT_SPARSE_SEGTYPE="snapshot"],
[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)])])
2011-08-24 12:27:49 +04:00
2014-10-31 01:38:02 +03:00
AC_DEFINE_UNQUOTED([DEFAULT_SPARSE_SEGTYPE], ["$DEFAULT_SPARSE_SEGTYPE"],
[Default segtype used for sparse volumes.])
2014-04-07 19:44:29 +04:00
dnl -- thin_check needs-check flag
AC_ARG_ENABLE(thin_check_needs_check,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-thin_check_needs_check],
2014-04-07 19:44:29 +04:00
[required if thin_check version is < 0.3.0]),
2023-02-09 19:37:17 +03:00
THIN_CHECK_NEEDS_CHECK=$enableval, THIN_CHECK_NEEDS_CHECK="yes")
2014-04-07 19:44:29 +04:00
2013-12-12 16:07:59 +04:00
# Test if necessary thin tools are available
# if not - use plain defaults and warn user
2022-11-27 17:35:07 +03:00
AS_CASE(["$THIN"],
[internal|shared], [
2012-03-14 21:09:00 +04:00
# Empty means a config way to ignore thin checking
2022-11-27 17:35:06 +03:00
AS_IF([test "$THIN_CHECK_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(THIN_CHECK_CMD, thin_check, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$THIN_CHECK_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN([thin_check not found in path $PATH_SBIN])
2023-02-09 19:37:17 +03:00
THIN_CHECK_CMD="/usr/sbin/thin_check"
THIN_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "yes" && test "$THIN_CONFIGURE_WARN" != "y"], [
2023-02-09 19:37:17 +03:00
THIN_CHECK_VSN=$("$THIN_CHECK_CMD" -V 2>/dev/null)
2023-10-10 23:03:50 +03:00
THIN_CHECK_VSN=${THIN_CHECK_VSN##* } # trim away all before the first space
2023-02-09 19:37:17 +03:00
THIN_CHECK_VSN_MAJOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}')
THIN_CHECK_VSN_MINOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}')
2014-05-12 16:51:23 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$THIN_CHECK_VSN_MAJOR" || test -z "$THIN_CHECK_VSN_MINOR"], [
2014-05-12 16:51:23 +04:00
AC_MSG_WARN([$THIN_CHECK_CMD: Bad version "$THIN_CHECK_VSN" found])
2023-02-09 19:37:17 +03:00
THIN_CHECK_VERSION_WARN="y"
THIN_CHECK_NEEDS_CHECK="no"
2022-11-27 17:35:06 +03:00
], [test "$THIN_CHECK_VSN_MAJOR" -eq 0 && test "$THIN_CHECK_VSN_MINOR" -lt 3], [
2014-05-12 16:51:23 +04:00
AC_MSG_WARN([$THIN_CHECK_CMD: Old version "$THIN_CHECK_VSN" found])
2023-02-09 19:37:17 +03:00
THIN_CHECK_VERSION_WARN="y"
THIN_CHECK_NEEDS_CHECK="no"
2022-11-27 17:35:06 +03:00
])
])
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore thin dumping
2022-11-27 17:35:06 +03:00
AS_IF([test "$THIN_DUMP_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(THIN_DUMP_CMD, thin_dump, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$THIN_DUMP_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN(["thin_dump not found in path $PATH_SBIN"])
2023-02-09 19:37:17 +03:00
THIN_DUMP_CMD="/usr/sbin/thin_dump"
THIN_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore thin repairing
2022-11-27 17:35:06 +03:00
AS_IF([test "$THIN_REPAIR_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(THIN_REPAIR_CMD, thin_repair, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$THIN_REPAIR_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN(["thin_repair not found in path $PATH_SBIN"])
2023-02-09 19:37:17 +03:00
THIN_REPAIR_CMD="/usr/sbin/thin_repair"
THIN_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore thin restoring
2022-11-27 17:35:06 +03:00
AS_IF([test "$THIN_RESTORE_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(THIN_RESTORE_CMD, thin_restore, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$THIN_RESTORE_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN(["thin_restore not found in path $PATH_SBIN"])
2023-02-09 19:37:17 +03:00
THIN_RESTORE_CMD="/usr/sbin/thin_restore"
THIN_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
2014-10-31 01:38:02 +03:00
2023-10-10 23:03:50 +03:00
AC_MSG_CHECKING([whether $THIN_CHECK_CMD ($THIN_CHECK_VSN_MAJOR.$THIN_CHECK_VSN_MINOR) supports the needs-check flag])
2014-10-31 01:38:02 +03:00
AC_MSG_RESULT([$THIN_CHECK_NEEDS_CHECK])
2022-11-27 17:35:06 +03:00
AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "yes"], [
2014-10-31 01:38:02 +03:00
AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
2022-11-27 17:35:06 +03:00
])
2022-11-27 17:35:07 +03:00
])
2012-03-14 21:09:00 +04:00
2012-03-14 23:25:04 +04:00
AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
[The path to 'thin_check', if available.])
2013-07-31 16:38:10 +04:00
AC_DEFINE_UNQUOTED([THIN_DUMP_CMD], ["$THIN_DUMP_CMD"],
[The path to 'thin_dump', if available.])
AC_DEFINE_UNQUOTED([THIN_REPAIR_CMD], ["$THIN_REPAIR_CMD"],
[The path to 'thin_repair', if available.])
2014-05-27 01:28:03 +04:00
AC_DEFINE_UNQUOTED([THIN_RESTORE_CMD], ["$THIN_RESTORE_CMD"],
[The path to 'thin_restore', if available.])
2014-01-27 15:27:16 +04:00
################################################################################
dnl -- cache inclusion type
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include cache])
2014-01-27 15:27:16 +04:00
AC_ARG_WITH(cache,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-cache=TYPE],
2021-04-08 22:29:44 +03:00
[cache support: internal/none [internal]]),
2014-09-18 02:13:15 +04:00
CACHE=$withval, CACHE="internal")
2014-07-04 18:31:29 +04:00
AC_ARG_WITH(cache-check,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-cache-check=PATH],
2014-10-30 19:13:05 +03:00
[cache_check tool: [autodetect]]),
2014-07-04 18:31:29 +04:00
CACHE_CHECK_CMD=$withval, CACHE_CHECK_CMD="autodetect")
AC_ARG_WITH(cache-dump,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-cache-dump=PATH],
2014-10-30 19:13:05 +03:00
[cache_dump tool: [autodetect]]),
2014-07-04 18:31:29 +04:00
CACHE_DUMP_CMD=$withval, CACHE_DUMP_CMD="autodetect")
AC_ARG_WITH(cache-repair,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-cache-repair=PATH],
2014-10-30 19:13:05 +03:00
[cache_repair tool: [autodetect]]),
2014-07-04 18:31:29 +04:00
CACHE_REPAIR_CMD=$withval, CACHE_REPAIR_CMD="autodetect")
AC_ARG_WITH(cache-restore,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-cache-restore=PATH],
2014-10-30 19:13:05 +03:00
[cache_restore tool: [autodetect]]),
2014-07-04 18:31:29 +04:00
CACHE_RESTORE_CMD=$withval, CACHE_RESTORE_CMD="autodetect")
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$CACHE])
2014-01-27 15:27:16 +04:00
2022-11-27 17:35:07 +03:00
AS_CASE(["$CACHE"],
[no|none|shared], [],
[internal], [
AC_DEFINE([CACHE_INTERNAL], 1, [Define to 1 to include built-in support for cache.])],
[AC_MSG_ERROR([--with-cache parameter invalid])])
2012-03-14 21:09:00 +04:00
2015-07-07 10:51:40 +03:00
dnl -- cache_check needs-check flag
AC_ARG_ENABLE(cache_check_needs_check,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-cache_check_needs_check],
2015-07-07 10:51:40 +03:00
[required if cache_check version is < 0.5]),
2023-02-09 19:37:17 +03:00
CACHE_CHECK_NEEDS_CHECK=$enableval, CACHE_CHECK_NEEDS_CHECK="yes")
2015-07-07 10:51:40 +03:00
2014-07-04 18:31:29 +04:00
# Test if necessary cache tools are available
# if not - use plain defaults and warn user
2022-11-27 17:35:07 +03:00
AS_CASE(["$CACHE"],
[internal|shared], [
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore cache checking
2022-11-27 17:35:06 +03:00
AS_IF([test "$CACHE_CHECK_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(CACHE_CHECK_CMD, cache_check, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$CACHE_CHECK_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN([cache_check not found in path $PATH_SBIN])
2023-02-09 19:37:17 +03:00
CACHE_CHECK_CMD="/usr/sbin/cache_check"
CACHE_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes" && test "$CACHE_CONFIGURE_WARN" != "y"], [
2023-10-10 23:03:50 +03:00
"$CACHE_CHECK_CMD" -V 2>/dev/null >conftest.tmp
2015-07-15 17:08:02 +03:00
read -r CACHE_CHECK_VSN < conftest.tmp
2015-09-03 23:48:56 +03:00
IFS=.- read -r CACHE_CHECK_VSN_MAJOR CACHE_CHECK_VSN_MINOR CACHE_CHECK_VSN_PATCH LEFTOVER < conftest.tmp
2015-07-15 17:08:02 +03:00
rm -f conftest.tmp
# Require version >= 0.5.4 for --clear-needs-check-flag
2023-10-10 23:03:50 +03:00
CACHE_CHECK_VSN_MAJOR=${CACHE_CHECK_VSN_MAJOR##* }
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$CACHE_CHECK_VSN_MAJOR" \
2015-07-15 17:08:02 +03:00
|| test -z "$CACHE_CHECK_VSN_MINOR" \
2022-11-27 17:35:06 +03:00
|| test -z "$CACHE_CHECK_VSN_PATCH"], [
2015-07-07 10:51:40 +03:00
AC_MSG_WARN([$CACHE_CHECK_CMD: Bad version "$CACHE_CHECK_VSN" found])
2023-02-09 19:37:17 +03:00
CACHE_CHECK_VERSION_WARN="y"
CACHE_CHECK_NEEDS_CHECK="no"
2022-11-27 17:35:06 +03:00
], [test "$CACHE_CHECK_VSN_MAJOR" -eq 0], [
AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 5 \
|| ( test "$CACHE_CHECK_VSN_MINOR" -eq 5 && test "$CACHE_CHECK_VSN_PATCH" -lt 4 )], [
2015-07-15 17:08:02 +03:00
AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" found])
2023-02-09 19:37:17 +03:00
CACHE_CHECK_VERSION_WARN="y"
CACHE_CHECK_NEEDS_CHECK="no"
2022-11-27 17:35:06 +03:00
])
AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 7], [
2017-06-09 23:30:23 +03:00
AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" does not support new cache format V2])
CACHE_CHECK_VERSION_WARN=y
2022-11-27 17:35:06 +03:00
])
])
])
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore cache dumping
2022-11-27 17:35:06 +03:00
AS_IF([test "$CACHE_DUMP_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(CACHE_DUMP_CMD, cache_dump, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$CACHE_DUMP_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN(["cache_dump not found in path $PATH_SBIN"])
2023-02-09 19:37:17 +03:00
CACHE_DUMP_CMD="/usr/sbin/cache_dump"
CACHE_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore cache repairing
2022-11-27 17:35:06 +03:00
AS_IF([test "$CACHE_REPAIR_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(CACHE_REPAIR_CMD, cache_repair, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$CACHE_REPAIR_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN(["cache_repair not found in path $PATH_SBIN"])
2023-02-09 19:37:17 +03:00
CACHE_REPAIR_CMD="/usr/sbin/cache_repair"
CACHE_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore cache restoring
2022-11-27 17:35:06 +03:00
AS_IF([test "$CACHE_RESTORE_CMD" = "autodetect"], [
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(CACHE_RESTORE_CMD, cache_restore, [], [$PATH_SBIN])
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$CACHE_RESTORE_CMD"], [
2023-02-13 02:07:01 +03:00
AC_MSG_WARN(["cache_restore not found in path $PATH_SBIN"])
2023-02-09 19:37:17 +03:00
CACHE_RESTORE_CMD="/usr/sbin/cache_restore"
CACHE_CONFIGURE_WARN="y"
2022-11-27 17:35:06 +03:00
])
])
2015-07-07 10:51:40 +03:00
2023-10-10 23:03:50 +03:00
AC_MSG_CHECKING([whether $CACHE_CHECK_CMD ($CACHE_CHECK_VSN_MAJOR.$CACHE_CHECK_VSN_MINOR.$CACHE_CHECK_VSN_PATCH) supports the needs-check flag])
2015-07-07 10:51:40 +03:00
AC_MSG_RESULT([$CACHE_CHECK_NEEDS_CHECK])
2022-11-27 17:35:06 +03:00
AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes"], [
2015-07-07 10:51:40 +03:00
AC_DEFINE([CACHE_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'cache_check' tool requires the --clear-needs-check-flag option])
2022-11-27 17:35:06 +03:00
])
2022-11-27 17:35:07 +03:00
])
2014-07-04 18:31:29 +04:00
AC_DEFINE_UNQUOTED([CACHE_CHECK_CMD], ["$CACHE_CHECK_CMD"],
[The path to 'cache_check', if available.])
AC_DEFINE_UNQUOTED([CACHE_DUMP_CMD], ["$CACHE_DUMP_CMD"],
[The path to 'cache_dump', if available.])
AC_DEFINE_UNQUOTED([CACHE_REPAIR_CMD], ["$CACHE_REPAIR_CMD"],
[The path to 'cache_repair', if available.])
AC_DEFINE_UNQUOTED([CACHE_RESTORE_CMD], ["$CACHE_RESTORE_CMD"],
[The path to 'cache_restore', if available.])
2018-06-29 14:38:18 +03:00
################################################################################
dnl -- cache inclusion type
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include vdo])
2018-06-29 14:38:18 +03:00
AC_ARG_WITH(vdo,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-vdo=TYPE],
2018-06-29 14:38:18 +03:00
[vdo support: internal/none [internal]]),
2020-09-09 16:56:06 +03:00
VDO=$withval, VDO="internal")
2018-06-29 14:38:18 +03:00
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$VDO])
2018-06-29 14:38:18 +03:00
AC_ARG_WITH(vdo-format,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-vdo-format=PATH],
2018-06-29 14:38:18 +03:00
[vdoformat tool: [autodetect]]),
VDO_FORMAT_CMD=$withval, VDO_FORMAT_CMD="autodetect")
2022-11-27 17:35:07 +03:00
AS_CASE(["$VDO"],
[no|none], [],
[internal], [
AC_DEFINE([VDO_INTERNAL], 1, [Define to 1 to include built-in support for vdo.])
AS_IF([test "$VDO_FORMAT_CMD" = "autodetect"], [
AC_PATH_TOOL(VDO_FORMAT_CMD, vdoformat, [], [$PATH])
AS_IF([test -z "$VDO_FORMAT_CMD"], [
AC_MSG_WARN([vdoformat not found in path $PATH])
2023-02-09 19:37:17 +03:00
VDO_FORMAT_CMD="/usr/bin/vdoformat"
2022-11-27 17:35:07 +03:00
VDO_CONFIGURE_WARN=y
])
])],
[AC_MSG_ERROR([--with-vdo parameter invalid])])
2018-06-29 14:38:18 +03:00
AC_DEFINE_UNQUOTED([VDO_FORMAT_CMD], ["$VDO_FORMAT_CMD"],
[The path to 'vdoformat', if available.])
#
# Do we need to use the API??
2023-07-02 18:46:47 +03:00
# Do we want to link lvm2 with a big library for vdoformatting ?
2018-06-29 14:38:18 +03:00
#
#AC_ARG_WITH(vdo-include,
2021-09-24 19:06:28 +03:00
# AS_HELP_STRING([--with-vdo-include=PATH],
2018-06-29 14:38:18 +03:00
# [vdo support: Path to utils headers: [/usr/include/vdo/utils]]),
# VDO_INCLUDE=$withval, VDO_INCLUDE="/usr/include/vdo/utils")
2023-02-09 19:37:17 +03:00
#AC_MSG_RESULT([$VDO_INCLUDE])
2018-06-29 14:38:18 +03:00
#
#AC_ARG_WITH(vdo-lib,
2021-09-24 19:06:28 +03:00
# AS_HELP_STRING([--with-vdo-lib=PATH],
2018-06-29 14:38:18 +03:00
# [vdo support: Path to utils lib: [/usr/lib]]),
2021-04-08 22:29:44 +03:00
# VDO_LIB=$withval, VDO_LIB="/usr/lib")
2023-02-09 19:37:17 +03:00
#AC_MSG_RESULT([$VDO_LIB])
2014-07-04 18:31:29 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2018-08-27 22:53:09 +03:00
dnl -- writecache inclusion type
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include writecache])
2018-08-27 22:53:09 +03:00
AC_ARG_WITH(writecache,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-writecache=TYPE],
2020-09-28 19:51:32 +03:00
[writecache support: internal/none [internal]]),
2020-09-09 16:56:06 +03:00
WRITECACHE=$withval, WRITECACHE="internal")
2018-08-27 22:53:09 +03:00
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$WRITECACHE])
2018-08-27 22:53:09 +03:00
2022-11-27 17:35:07 +03:00
AS_CASE(["$WRITECACHE"],
[no|none], [],
[internal], [
AC_DEFINE([WRITECACHE_INTERNAL], 1, [Define to 1 to include built-in support for writecache.])],
[AC_MSG_ERROR([--with-writecache parameter invalid])])
2018-08-27 22:53:09 +03:00
2019-11-21 01:07:27 +03:00
################################################################################
dnl -- integrity inclusion type
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include integrity])
2019-11-21 01:07:27 +03:00
AC_ARG_WITH(integrity,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-integrity=TYPE],
2020-09-28 19:51:32 +03:00
[integrity support: internal/none [internal]]),
2020-09-16 23:14:51 +03:00
INTEGRITY=$withval, INTEGRITY="internal")
2019-11-21 01:07:27 +03:00
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$INTEGRITY])
2019-11-21 01:07:27 +03:00
2022-11-27 17:35:07 +03:00
AS_CASE(["$INTEGRITY"],
[no|none], [],
[internal], [
AC_DEFINE([INTEGRITY_INTERNAL], 1, [Define to 1 to include built-in support for integrity.])],
[AC_MSG_ERROR([--with-integrity parameter invalid])])
2019-11-21 01:07:27 +03:00
2018-08-27 22:53:09 +03:00
################################################################################
2008-06-27 23:57:27 +04:00
dnl -- Disable readline
2008-06-23 13:23:48 +04:00
AC_ARG_ENABLE([readline],
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-readline], [disable readline support]),
2023-02-09 19:37:17 +03:00
READLINE=$enableval, READLINE="maybe")
2001-09-21 16:37:43 +04:00
2020-09-26 22:32:55 +03:00
################################################################################
dnl -- Disable editline
AC_ARG_ENABLE([editline],
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-editline], [enable editline support]),
2023-02-09 19:37:17 +03:00
EDITLINE=$enableval, EDITLINE="no")
2020-09-26 22:32:55 +03:00
2006-10-01 00:02:02 +04:00
################################################################################
dnl -- Disable realtime clock support
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable realtime support])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(realtime,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-realtime], [disable realtime clock support]),
2023-02-09 19:37:17 +03:00
REALTIME=$enableval, REALTIME="yes")
AC_MSG_RESULT([$REALTIME])
2006-10-01 00:02:02 +04:00
2010-11-05 19:18:38 +03:00
################################################################################
dnl -- disable OCF resource agents
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable OCF resource agents])
2010-11-05 19:18:38 +03:00
AC_ARG_ENABLE(ocf,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-ocf],
2010-11-05 19:18:38 +03:00
[enable Open Cluster Framework (OCF) compliant resource agents]),
2023-02-09 19:37:17 +03:00
OCF=$enableval, OCF="no")
AC_MSG_RESULT([$OCF])
2011-01-10 16:00:53 +03:00
AC_ARG_WITH(ocfdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-ocfdir=DIR],
2014-10-30 19:13:05 +03:00
[install OCF files in [PREFIX/lib/ocf/resource.d/lvm2]]),
2014-11-20 10:22:34 +03:00
OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
2010-11-05 19:18:38 +03:00
2012-06-21 16:41:52 +04:00
################################################################################
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([for default run directory])
2015-05-03 00:57:52 +03:00
RUN_DIR="/run"
2023-02-22 16:11:50 +03:00
AS_IF([test ! -d "$RUN_DIR"], [RUN_DIR="/var/run"])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$RUN_DIR])
2012-06-21 16:41:52 +04:00
dnl -- Set up pidfile and run directory
AH_TEMPLATE(DEFAULT_PID_DIR)
AC_ARG_WITH(default-pid-dir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-pid-dir=PID_DIR],
2020-09-28 19:51:32 +03:00
[default directory to keep PID files in [autodetect]]),
2015-05-03 00:57:52 +03:00
DEFAULT_PID_DIR="$withval", DEFAULT_PID_DIR=$RUN_DIR)
2012-06-21 16:41:52 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_PID_DIR, ["$DEFAULT_PID_DIR"],
[Default directory to keep PID files in.])
AH_TEMPLATE(DEFAULT_DM_RUN_DIR, [Name of default DM run directory.])
AC_ARG_WITH(default-dm-run-dir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-dm-run-dir=DM_RUN_DIR],
2020-09-28 19:51:32 +03:00
[default DM run directory [autodetect]]),
2015-05-03 00:57:52 +03:00
DEFAULT_DM_RUN_DIR="$withval", DEFAULT_DM_RUN_DIR=$RUN_DIR)
2012-06-21 16:41:52 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_DM_RUN_DIR, ["$DEFAULT_DM_RUN_DIR"],
[Default DM run directory.])
AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default LVM run directory.])
AC_ARG_WITH(default-run-dir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-run-dir=RUN_DIR],
2020-09-28 19:51:32 +03:00
[default LVM run directory [autodetect_run_dir/lvm]]),
2015-05-03 00:57:52 +03:00
DEFAULT_RUN_DIR="$withval", DEFAULT_RUN_DIR="$RUN_DIR/lvm")
2012-06-21 16:41:52 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR, ["$DEFAULT_RUN_DIR"],
[Default LVM run directory.])
2009-08-13 20:34:07 +04:00
################################################################################
2009-08-29 00:51:40 +04:00
dnl -- Build cluster mirror log daemon
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build cluster mirror log daemon])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(cmirrord,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-cmirrord],
2010-07-08 16:02:48 +04:00
[enable the cluster mirror log daemon]),
2023-02-22 16:11:50 +03:00
BUILD_CMIRRORD=$enableval, BUILD_CMIRRORD="no")
AC_MSG_RESULT([$BUILD_CMIRRORD])
2009-08-29 00:51:40 +04:00
################################################################################
dnl -- cmirrord pidfile
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_CMIRRORD" = "yes"], [
2009-08-29 00:51:40 +04:00
AC_ARG_WITH(cmirrord-pidfile,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-cmirrord-pidfile=PATH],
2014-10-30 19:13:05 +03:00
[cmirrord pidfile [PID_DIR/cmirrord.pid]]),
2010-07-08 16:02:48 +04:00
CMIRRORD_PIDFILE=$withval,
2012-06-21 16:41:52 +04:00
CMIRRORD_PIDFILE="$DEFAULT_PID_DIR/cmirrord.pid")
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"],
[Path to cmirrord pidfile.])
2022-11-27 17:35:06 +03:00
])
2009-08-29 00:51:40 +04:00
################################################################################
2009-08-13 20:34:07 +04:00
dnl -- Look for corosync libraries if required.
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_CMIRRORD" = "yes" && test "$HAVE_CPG" != "yes"], [
PKG_CHECK_MODULES([CPG], [libcpg])
])
2009-08-13 20:34:07 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Enable debugging
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable debugging])
2021-09-24 19:06:28 +03:00
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable debugging]),
2023-02-09 19:37:17 +03:00
DEBUG=$enableval, DEBUG="no")
AC_MSG_RESULT([$DEBUG])
2002-12-20 02:25:55 +03:00
2004-06-29 17:29:25 +04:00
dnl -- Normally turn off optimisation for debug builds
2022-11-27 17:35:06 +03:00
AS_IF([test "$DEBUG" = "yes"], [COPTIMISE_FLAG=""], [CSCOPE_CMD=""])
2004-06-29 17:29:25 +04:00
2013-10-24 23:40:25 +04:00
dnl -- Check if compiler supports -Wjump-misses-init
AC_TRY_CCFLAG([-Wjump-misses-init], [HAVE_WJUMP], [], [])
AC_SUBST(HAVE_WJUMP)
2013-10-25 03:00:10 +04:00
AC_TRY_CCFLAG([-Wclobbered], [HAVE_WCLOBBERED], [], [])
AC_SUBST(HAVE_WCLOBBERED)
2015-03-10 15:36:55 +03:00
AC_TRY_CCFLAG([-Wsync-nand], [HAVE_WSYNCNAND], [], [])
AC_SUBST(HAVE_WSYNCNAND)
2013-10-24 23:40:25 +04:00
2004-06-29 17:29:25 +04:00
################################################################################
dnl -- Override optimisation
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([for C optimisation flag])
2004-06-29 17:29:25 +04:00
AC_ARG_WITH(optimisation,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-optimisation=OPT],
2014-10-30 19:13:05 +03:00
[C optimisation flag [OPT=-O2]]),
2010-07-08 16:02:48 +04:00
COPTIMISE_FLAG=$withval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$COPTIMISE_FLAG])
2004-06-29 17:29:25 +04:00
2021-03-29 22:46:12 +03:00
################################################################################
dnl -- Symbol versioning
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to use symbol versioning])
2021-03-29 22:46:12 +03:00
AC_ARG_WITH(symvers,
2022-11-27 17:35:07 +03:00
AS_HELP_STRING([--with-symvers=STYLE],
[use symbol versioning of the shared library [default=gnu]]), [
AS_CASE(["$withval"],
[gnu|no], [symvers=$withval],
[AC_MSG_ERROR(--with-symvers parameter invalid)])],
2023-02-09 19:37:17 +03:00
[symvers="gnu"])
AC_MSG_RESULT([$symvers])
2021-03-29 22:46:12 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$GCC" = "yes" && test "$symvers" = "gnu"], [
2021-03-29 22:46:12 +03:00
AC_DEFINE(GNU_SYMVER, 1,
[Define to use GNU versioning in the shared library.])
2022-11-27 17:35:07 +03:00
AS_CASE(["$host_os"],
[linux*], [
2021-03-29 22:46:12 +03:00
CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
2022-11-27 17:35:07 +03:00
LDDEPS="$LDDEPS .export.sym"])
2022-11-27 17:35:06 +03:00
])
2021-03-29 22:46:12 +03:00
2008-06-27 19:35:09 +04:00
################################################################################
dnl -- Enable profiling
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to gather gcov profiling data])
2008-06-27 19:35:09 +04:00
AC_ARG_ENABLE(profiling,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-profiling],
2014-06-05 19:28:03 +04:00
[gather gcov profiling data]),
2023-02-09 19:37:17 +03:00
PROFILING=$enableval, PROFILING="no")
AC_MSG_RESULT([$PROFILING])
2008-06-27 23:24:17 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$PROFILING" = "yes"], [
2024-03-27 02:19:52 +03:00
COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -fprofile-update=atomic -ftest-coverage"
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(LCOV, lcov)
AC_PATH_TOOL(GENHTML, genhtml)
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$LCOV" || test -z "$GENHTML"], [
AC_MSG_ERROR([lcov and genhtml are required for profiling])
])
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(GENPNG, genpng)
2022-11-27 17:35:06 +03:00
AS_IF([test -n "$GENPNG"], [
2010-04-06 15:53:53 +04:00
AC_MSG_CHECKING([whether $GENPNG has all required modules])
2022-11-27 17:35:06 +03:00
AS_IF(["$GENPNG" --help > /dev/null 2>&1], [
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([ok])
2010-04-06 15:53:53 +04:00
GENHTML="$GENHTML --frames"
2022-11-27 17:35:06 +03:00
], [
2014-06-05 19:28:03 +04:00
AC_MSG_RESULT([not supported])
2010-04-06 15:53:53 +04:00
AC_MSG_WARN([GD.pm perl module is not installed])
GENPNG=
2022-11-27 17:35:06 +03:00
])
])
])
2008-06-27 19:35:09 +04:00
2015-07-14 21:27:31 +03:00
################################################################################
dnl -- Set LVM2 testsuite data
TESTSUITE_DATA='${datarootdir}/lvm2-testsuite'
# double eval needed ${datarootdir} -> ${prefix}/share -> real path
AC_DEFINE_UNQUOTED(TESTSUITE_DATA, ["$(eval echo $(eval echo $TESTSUITE_DATA))"], [Path to testsuite data])
2010-08-09 14:56:01 +04:00
################################################################################
dnl -- Enable valgrind awareness of memory pools
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable valgrind awareness of pools])
2010-08-09 14:56:01 +04:00
AC_ARG_ENABLE(valgrind_pool,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-valgrind-pool],
2014-06-05 19:28:03 +04:00
[enable valgrind awareness of pools]),
2023-02-09 19:37:17 +03:00
VALGRIND_POOL=$enableval, VALGRIND_POOL="no")
AC_MSG_RESULT([$VALGRIND_POOL])
2010-08-09 14:56:01 +04:00
2023-02-09 19:37:17 +03:00
PKG_CHECK_MODULES(VALGRIND, valgrind, [HAVE_VALGRIND="yes"], [
2022-11-27 17:35:06 +03:00
AS_IF([test "$VALGRIND_POOL" = "yes"], [AC_MSG_ERROR(bailing out)])
])
2014-10-01 10:16:27 +04:00
AC_SUBST(VALGRIND_CFLAGS)
2022-11-27 17:35:06 +03:00
AS_IF([test "$HAVE_VALGRIND" = "yes"], [
2014-10-01 10:16:27 +04:00
AC_DEFINE([HAVE_VALGRIND], 1, [valgrind.h found])
2022-11-27 17:35:06 +03:00
])
2014-10-01 10:16:27 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$VALGRIND_POOL" = "yes"], [
2014-06-05 19:28:03 +04:00
AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
2022-11-27 17:35:06 +03:00
])
2010-08-09 14:56:01 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Disable devmapper
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to use device-mapper])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(devmapper,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-devmapper],
2010-07-08 16:02:48 +04:00
[disable LVM2 device-mapper interaction]),
DEVMAPPER=$enableval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$DEVMAPPER])
2003-01-09 01:44:07 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$DEVMAPPER" = "yes"], [
2008-11-01 01:06:09 +03:00
AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
2022-11-27 17:35:06 +03:00
])
2003-04-15 17:24:42 +04:00
2015-05-09 02:59:18 +03:00
################################################################################
dnl -- Build lvmpolld
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build lvmpolld])
2015-05-09 02:59:18 +03:00
AC_ARG_ENABLE(lvmpolld,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-lvmpolld],
2015-05-09 02:59:18 +03:00
[enable the LVM Polling Daemon]),
2023-02-22 16:11:50 +03:00
BUILD_LVMPOLLD=$enableval, BUILD_LVMPOLLD="no")
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$BUILD_LVMPOLLD])
2015-05-09 02:59:18 +03:00
2015-07-06 20:20:20 +03:00
################################################################################
2015-11-02 22:04:50 +03:00
BUILD_LVMLOCKD=no
2017-04-18 19:02:49 +03:00
dnl -- Build lvmlockdsanlock
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build lvmlockdsanlock])
2017-04-18 19:02:49 +03:00
AC_ARG_ENABLE(lvmlockd-sanlock,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-lvmlockd-sanlock],
2015-07-06 20:20:20 +03:00
[enable the LVM lock daemon using sanlock]),
2023-02-13 02:07:01 +03:00
BUILD_LOCKDSANLOCK=$enableval, BUILD_LOCKDSANLOCK="no")
AC_MSG_RESULT([$BUILD_LOCKDSANLOCK])
2015-07-06 20:20:20 +03:00
dnl -- Look for sanlock libraries
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LOCKDSANLOCK" = "yes"], [
2024-04-15 14:37:16 +03:00
PKG_CHECK_MODULES(LIBSANLOCKCLIENT, libsanlock_client >= 3.7.0, [BUILD_LVMLOCKD="yes"])
2015-11-02 22:04:50 +03:00
AC_DEFINE([LOCKDSANLOCK_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd sanlock option.])
2022-11-27 17:35:06 +03:00
])
2015-07-06 20:20:20 +03:00
################################################################################
2017-04-18 19:02:49 +03:00
dnl -- Build lvmlockddlm
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build lvmlockddlm])
2017-04-18 19:02:49 +03:00
AC_ARG_ENABLE(lvmlockd-dlm,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-lvmlockd-dlm],
2015-07-06 20:20:20 +03:00
[enable the LVM lock daemon using dlm]),
2023-02-13 02:07:01 +03:00
BUILD_LOCKDDLM=$enableval, BUILD_LOCKDDLM="no")
AC_MSG_RESULT([$BUILD_LOCKDDLM])
2015-07-06 20:20:20 +03:00
dnl -- Look for dlm libraries
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LOCKDDLM" = "yes"], [
2023-02-21 01:57:56 +03:00
PKG_CHECK_MODULES(LIBDLM, libdlm_lt, [BUILD_LVMLOCKD="yes"])
2015-11-02 22:04:50 +03:00
AC_DEFINE([LOCKDDLM_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd dlm option.])
2023-02-20 23:01:31 +03:00
AS_CASE(["$LIBDLM_LIBS"],
[*lpthread*], [
dnl -- pkg-congig for libdlm_lt may give us libdlm with libpthread
AC_MSG_RESULT([replacing pkg-config --libs libdlm_lt "$LIBDLM_LIBS" with... -ldlm_lt])
LIBDLM_LIBS="${LIBDLM_LIBS%%ldlm*}ldlm_lt"])
2022-11-27 17:35:06 +03:00
])
2015-05-09 02:59:18 +03:00
2019-03-20 21:20:26 +03:00
################################################################################
dnl -- Build lvmlockddlmcontrol
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build lvmlockddlmcontrol])
2019-03-20 21:20:26 +03:00
AC_ARG_ENABLE(lvmlockd-dlmcontrol,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-lvmlockd-dlmcontrol],
2019-03-20 21:20:26 +03:00
[enable lvmlockd remote refresh using libdlmcontrol]),
2023-02-13 02:07:01 +03:00
BUILD_LOCKDDLM_CONTROL=$enableval, BUILD_LOCKDDLM_CONTROL="no")
AC_MSG_RESULT([$BUILD_LOCKDDLM_CONTROL])
2019-03-20 21:20:26 +03:00
dnl -- Look for libdlmcontrol libraries
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LOCKDDLM_CONTROL" = "yes"], [
2023-02-21 01:57:56 +03:00
PKG_CHECK_MODULES(LIBDLMCONTROL, [libdlmcontrol >= 3.2], [BUILD_LVMLOCKD="yes"])
2019-03-20 21:20:26 +03:00
AC_DEFINE([LOCKDDLM_CONTROL_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd dlm control option.])
2022-11-27 17:35:06 +03:00
])
2019-03-20 21:20:26 +03:00
lvmlockd: idm: Introduce new locking scheme
Alongside the existed locking schemes of DLM and sanlock, this patch is
to introduce new locking scheme: In-Drive-Mutex (IDM).
With the IDM support in the drive, the locks are resident in the drive,
thus, the locking lease is maintained in a central place: the drive
firmware. We can consider this is a typical client-server model,
every host (or node) in the server cluster launches the request for
leasing mutex to a drive firmware, the drive firmware works as an
arbitrator to grant the mutex to a requester and it can reject other
applicants if the mutex has been acquired. To satisfy the LVM
activation for different modes, IDM supports two locking modes:
exclusive and shareable.
Every IDM is identified with two IDs, one is the host ID and another is
the resource ID. The resource ID is a unique identifier for what the
resource it's protected, in the integration with lvmlockd, the resource
ID is combined with VG's UUID and LV's UUID; for the global locking,
the bytes in resource ID are all zeros, and for the VG locking, the
LV's UUID is set as zero. Every host can generate a random UUID and
use it as the host ID for the SCSI command, this ID is used to clarify
the ownership for mutex.
For easily invoking the IDM commands to drive, like other locking
scheme (e.g. sanlock), a daemon program named IDM lock manager is
created, so the detailed IDM SCSI commands are encapsulated in the
daemon, and lvmlockd uses the wrapper APIs to communicate with the
daemon program.
This patch introduces the IDM locking wrapper layer, it forwards the
locking requests from lvmlockd to the IDM lock manager, and returns the
result from drives' responding.
One thing should be mentioned is the IDM's LVB. IDM supports LVB to max
7 bytes when stores into the drive, the most significant byte of 8 bytes
is reserved for control bits. For this reason, the patch maps the
timestamp in macrosecond unit with its cached LVB, essentially, if any
timestamp was updated by other nodes, that means the local LVB is
invalidate. When the timestamp is stored into drive's LVB, it's
possbile to cause time-going-backwards issue, which is introduced by the
time precision or missing synchronization acrossing over multiple nodes.
So the IDM wrapper fixes up the timestamp by increment 1 to the latest
value and write back into drive.
Currently LVB is used to track VG changes and its purpose is to notify
lvmetad cache invalidation when detects any metadata has been altered;
but lvmetad is not used anymore for caching metadata, LVB doesn't
really work. It's possible that the LVB functionality could be useful
again in the future, so let's enable it for IDM in the first place.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
2021-05-07 05:25:12 +03:00
################################################################################
dnl -- Build lvmlockdidm
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build lvmlockdidm])
lvmlockd: idm: Introduce new locking scheme
Alongside the existed locking schemes of DLM and sanlock, this patch is
to introduce new locking scheme: In-Drive-Mutex (IDM).
With the IDM support in the drive, the locks are resident in the drive,
thus, the locking lease is maintained in a central place: the drive
firmware. We can consider this is a typical client-server model,
every host (or node) in the server cluster launches the request for
leasing mutex to a drive firmware, the drive firmware works as an
arbitrator to grant the mutex to a requester and it can reject other
applicants if the mutex has been acquired. To satisfy the LVM
activation for different modes, IDM supports two locking modes:
exclusive and shareable.
Every IDM is identified with two IDs, one is the host ID and another is
the resource ID. The resource ID is a unique identifier for what the
resource it's protected, in the integration with lvmlockd, the resource
ID is combined with VG's UUID and LV's UUID; for the global locking,
the bytes in resource ID are all zeros, and for the VG locking, the
LV's UUID is set as zero. Every host can generate a random UUID and
use it as the host ID for the SCSI command, this ID is used to clarify
the ownership for mutex.
For easily invoking the IDM commands to drive, like other locking
scheme (e.g. sanlock), a daemon program named IDM lock manager is
created, so the detailed IDM SCSI commands are encapsulated in the
daemon, and lvmlockd uses the wrapper APIs to communicate with the
daemon program.
This patch introduces the IDM locking wrapper layer, it forwards the
locking requests from lvmlockd to the IDM lock manager, and returns the
result from drives' responding.
One thing should be mentioned is the IDM's LVB. IDM supports LVB to max
7 bytes when stores into the drive, the most significant byte of 8 bytes
is reserved for control bits. For this reason, the patch maps the
timestamp in macrosecond unit with its cached LVB, essentially, if any
timestamp was updated by other nodes, that means the local LVB is
invalidate. When the timestamp is stored into drive's LVB, it's
possbile to cause time-going-backwards issue, which is introduced by the
time precision or missing synchronization acrossing over multiple nodes.
So the IDM wrapper fixes up the timestamp by increment 1 to the latest
value and write back into drive.
Currently LVB is used to track VG changes and its purpose is to notify
lvmetad cache invalidation when detects any metadata has been altered;
but lvmetad is not used anymore for caching metadata, LVB doesn't
really work. It's possible that the LVB functionality could be useful
again in the future, so let's enable it for IDM in the first place.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
2021-05-07 05:25:12 +03:00
AC_ARG_ENABLE(lvmlockd-idm,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-lvmlockd-idm],
lvmlockd: idm: Introduce new locking scheme
Alongside the existed locking schemes of DLM and sanlock, this patch is
to introduce new locking scheme: In-Drive-Mutex (IDM).
With the IDM support in the drive, the locks are resident in the drive,
thus, the locking lease is maintained in a central place: the drive
firmware. We can consider this is a typical client-server model,
every host (or node) in the server cluster launches the request for
leasing mutex to a drive firmware, the drive firmware works as an
arbitrator to grant the mutex to a requester and it can reject other
applicants if the mutex has been acquired. To satisfy the LVM
activation for different modes, IDM supports two locking modes:
exclusive and shareable.
Every IDM is identified with two IDs, one is the host ID and another is
the resource ID. The resource ID is a unique identifier for what the
resource it's protected, in the integration with lvmlockd, the resource
ID is combined with VG's UUID and LV's UUID; for the global locking,
the bytes in resource ID are all zeros, and for the VG locking, the
LV's UUID is set as zero. Every host can generate a random UUID and
use it as the host ID for the SCSI command, this ID is used to clarify
the ownership for mutex.
For easily invoking the IDM commands to drive, like other locking
scheme (e.g. sanlock), a daemon program named IDM lock manager is
created, so the detailed IDM SCSI commands are encapsulated in the
daemon, and lvmlockd uses the wrapper APIs to communicate with the
daemon program.
This patch introduces the IDM locking wrapper layer, it forwards the
locking requests from lvmlockd to the IDM lock manager, and returns the
result from drives' responding.
One thing should be mentioned is the IDM's LVB. IDM supports LVB to max
7 bytes when stores into the drive, the most significant byte of 8 bytes
is reserved for control bits. For this reason, the patch maps the
timestamp in macrosecond unit with its cached LVB, essentially, if any
timestamp was updated by other nodes, that means the local LVB is
invalidate. When the timestamp is stored into drive's LVB, it's
possbile to cause time-going-backwards issue, which is introduced by the
time precision or missing synchronization acrossing over multiple nodes.
So the IDM wrapper fixes up the timestamp by increment 1 to the latest
value and write back into drive.
Currently LVB is used to track VG changes and its purpose is to notify
lvmetad cache invalidation when detects any metadata has been altered;
but lvmetad is not used anymore for caching metadata, LVB doesn't
really work. It's possible that the LVB functionality could be useful
again in the future, so let's enable it for IDM in the first place.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
2021-05-07 05:25:12 +03:00
[enable the LVM lock daemon using idm]),
2023-02-13 02:07:01 +03:00
BUILD_LOCKDIDM=$enableval, BUILD_LOCKDIDM="no")
AC_MSG_RESULT([$BUILD_LOCKDIDM])
lvmlockd: idm: Introduce new locking scheme
Alongside the existed locking schemes of DLM and sanlock, this patch is
to introduce new locking scheme: In-Drive-Mutex (IDM).
With the IDM support in the drive, the locks are resident in the drive,
thus, the locking lease is maintained in a central place: the drive
firmware. We can consider this is a typical client-server model,
every host (or node) in the server cluster launches the request for
leasing mutex to a drive firmware, the drive firmware works as an
arbitrator to grant the mutex to a requester and it can reject other
applicants if the mutex has been acquired. To satisfy the LVM
activation for different modes, IDM supports two locking modes:
exclusive and shareable.
Every IDM is identified with two IDs, one is the host ID and another is
the resource ID. The resource ID is a unique identifier for what the
resource it's protected, in the integration with lvmlockd, the resource
ID is combined with VG's UUID and LV's UUID; for the global locking,
the bytes in resource ID are all zeros, and for the VG locking, the
LV's UUID is set as zero. Every host can generate a random UUID and
use it as the host ID for the SCSI command, this ID is used to clarify
the ownership for mutex.
For easily invoking the IDM commands to drive, like other locking
scheme (e.g. sanlock), a daemon program named IDM lock manager is
created, so the detailed IDM SCSI commands are encapsulated in the
daemon, and lvmlockd uses the wrapper APIs to communicate with the
daemon program.
This patch introduces the IDM locking wrapper layer, it forwards the
locking requests from lvmlockd to the IDM lock manager, and returns the
result from drives' responding.
One thing should be mentioned is the IDM's LVB. IDM supports LVB to max
7 bytes when stores into the drive, the most significant byte of 8 bytes
is reserved for control bits. For this reason, the patch maps the
timestamp in macrosecond unit with its cached LVB, essentially, if any
timestamp was updated by other nodes, that means the local LVB is
invalidate. When the timestamp is stored into drive's LVB, it's
possbile to cause time-going-backwards issue, which is introduced by the
time precision or missing synchronization acrossing over multiple nodes.
So the IDM wrapper fixes up the timestamp by increment 1 to the latest
value and write back into drive.
Currently LVB is used to track VG changes and its purpose is to notify
lvmetad cache invalidation when detects any metadata has been altered;
but lvmetad is not used anymore for caching metadata, LVB doesn't
really work. It's possible that the LVB functionality could be useful
again in the future, so let's enable it for IDM in the first place.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
2021-05-07 05:25:12 +03:00
dnl -- Look for Seagate IDM libraries
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LOCKDIDM" = "yes"], [
2023-02-17 01:28:08 +03:00
PKG_CHECK_EXISTS(blkid >= 2.24, [
2023-02-21 01:57:56 +03:00
PKG_CHECK_MODULES(LIBSEAGATEILM, [libseagate_ilm >= 0.1.0], [BUILD_LVMLOCKD="yes"])
2023-02-17 01:28:08 +03:00
AC_DEFINE([LOCKDIDM_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd IDM option.])
2023-02-20 23:01:31 +03:00
AS_IF([test -z "$LIBSEAGATEILM_LIBS"], [LIBSEAGATEILM_LIBS="-lseagate_ilm"])
2023-02-17 01:28:08 +03:00
], $bailout)
2022-11-27 17:35:06 +03:00
])
lvmlockd: idm: Introduce new locking scheme
Alongside the existed locking schemes of DLM and sanlock, this patch is
to introduce new locking scheme: In-Drive-Mutex (IDM).
With the IDM support in the drive, the locks are resident in the drive,
thus, the locking lease is maintained in a central place: the drive
firmware. We can consider this is a typical client-server model,
every host (or node) in the server cluster launches the request for
leasing mutex to a drive firmware, the drive firmware works as an
arbitrator to grant the mutex to a requester and it can reject other
applicants if the mutex has been acquired. To satisfy the LVM
activation for different modes, IDM supports two locking modes:
exclusive and shareable.
Every IDM is identified with two IDs, one is the host ID and another is
the resource ID. The resource ID is a unique identifier for what the
resource it's protected, in the integration with lvmlockd, the resource
ID is combined with VG's UUID and LV's UUID; for the global locking,
the bytes in resource ID are all zeros, and for the VG locking, the
LV's UUID is set as zero. Every host can generate a random UUID and
use it as the host ID for the SCSI command, this ID is used to clarify
the ownership for mutex.
For easily invoking the IDM commands to drive, like other locking
scheme (e.g. sanlock), a daemon program named IDM lock manager is
created, so the detailed IDM SCSI commands are encapsulated in the
daemon, and lvmlockd uses the wrapper APIs to communicate with the
daemon program.
This patch introduces the IDM locking wrapper layer, it forwards the
locking requests from lvmlockd to the IDM lock manager, and returns the
result from drives' responding.
One thing should be mentioned is the IDM's LVB. IDM supports LVB to max
7 bytes when stores into the drive, the most significant byte of 8 bytes
is reserved for control bits. For this reason, the patch maps the
timestamp in macrosecond unit with its cached LVB, essentially, if any
timestamp was updated by other nodes, that means the local LVB is
invalidate. When the timestamp is stored into drive's LVB, it's
possbile to cause time-going-backwards issue, which is introduced by the
time precision or missing synchronization acrossing over multiple nodes.
So the IDM wrapper fixes up the timestamp by increment 1 to the latest
value and write back into drive.
Currently LVB is used to track VG changes and its purpose is to notify
lvmetad cache invalidation when detects any metadata has been altered;
but lvmetad is not used anymore for caching metadata, LVB doesn't
really work. It's possible that the LVB functionality could be useful
again in the future, so let's enable it for IDM in the first place.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
2021-05-07 05:25:12 +03:00
2013-11-14 17:03:24 +04:00
################################################################################
2015-03-05 23:00:44 +03:00
dnl -- Build lvmlockd
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to build lvmlockd])
AC_MSG_RESULT([$BUILD_LVMLOCKD])
2015-03-05 23:00:44 +03:00
2023-03-01 01:13:00 +03:00
DEFAULT_USE_LVMLOCKD=0
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LVMLOCKD" = "yes"], [
AS_IF([test "$LVMPOLLD" = "no"], [AC_MSG_ERROR([cannot build lvmlockd with --disable-lvmpolld.])])
AS_IF([test "$BUILD_LVMPOLLD" = "no"], [BUILD_LVMPOLLD=yes; AC_MSG_WARN([Enabling lvmpolld - required by lvmlockd.])])
2015-03-05 23:00:44 +03:00
AC_MSG_CHECKING([defaults for use_lvmlockd])
AC_ARG_ENABLE(use_lvmlockd,
2023-03-01 01:13:00 +03:00
[AS_HELP_STRING([--disable-use-lvmlockd], [disable usage of LVM lock daemon])],
[use_lvmlockd=$enableval],[use_lvmlockd="yes"])
AS_IF([test "$use_lvmlockd" = "yes"], [DEFAULT_USE_LVMLOCKD=1])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$DEFAULT_USE_LVMLOCKD])
2015-03-05 23:00:44 +03:00
AC_DEFINE([LVMLOCKD_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd.])
AC_ARG_WITH(lvmlockd-pidfile,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-lvmlockd-pidfile=PATH],
2015-03-05 23:00:44 +03:00
[lvmlockd pidfile [PID_DIR/lvmlockd.pid]]),
LVMLOCKD_PIDFILE=$withval,
LVMLOCKD_PIDFILE="$DEFAULT_PID_DIR/lvmlockd.pid")
AC_DEFINE_UNQUOTED(LVMLOCKD_PIDFILE, ["$LVMLOCKD_PIDFILE"],
[Path to lvmlockd pidfile.])
2022-11-27 17:35:06 +03:00
])
2015-03-05 23:00:44 +03:00
AC_DEFINE_UNQUOTED(DEFAULT_USE_LVMLOCKD, [$DEFAULT_USE_LVMLOCKD],
[Use lvmlockd by default.])
2015-07-06 18:42:11 +03:00
################################################################################
2015-07-06 20:20:20 +03:00
dnl -- Check lvmpolld
2023-03-01 01:13:00 +03:00
DEFAULT_USE_LVMPOLLD=0
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LVMPOLLD" = "yes"], [
2015-07-06 20:20:20 +03:00
AC_MSG_CHECKING([defaults for use_lvmpolld])
AC_ARG_ENABLE(use_lvmpolld,
2023-03-01 01:13:00 +03:00
[AS_HELP_STRING([--disable-use-lvmpolld], [disable usage of LVM Poll Daemon])],
[use_lvmpolld=$enableval], [use_lvmpolld="yes"])
AS_IF([test "$use_lvmpolld" = "yes"], [DEFAULT_USE_LVMPOLLD=1])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$DEFAULT_USE_LVMPOLLD])
2015-07-06 20:20:20 +03:00
AC_DEFINE([LVMPOLLD_SUPPORT], 1, [Define to 1 to include code that uses lvmpolld.])
2015-07-06 18:42:11 +03:00
2015-07-06 20:20:20 +03:00
AC_ARG_WITH(lvmpolld-pidfile,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-lvmpolld-pidfile=PATH],
2015-07-06 20:20:20 +03:00
[lvmpolld pidfile [PID_DIR/lvmpolld.pid]]),
LVMPOLLD_PIDFILE=$withval,
LVMPOLLD_PIDFILE="$DEFAULT_PID_DIR/lvmpolld.pid")
AC_DEFINE_UNQUOTED(LVMPOLLD_PIDFILE, ["$LVMPOLLD_PIDFILE"],
[Path to lvmpolld pidfile.])
2022-11-27 17:35:06 +03:00
])
2015-07-06 20:20:20 +03:00
AC_DEFINE_UNQUOTED(DEFAULT_USE_LVMPOLLD, [$DEFAULT_USE_LVMPOLLD],
[Use lvmpolld by default.])
2015-03-05 23:00:44 +03:00
2017-03-10 00:12:53 +03:00
2021-10-15 10:55:08 +03:00
SYSTEMD_MIN_VERSION=0
2023-10-13 22:28:56 +03:00
NOTIFYDBUS_SUPPORT="no"
2023-10-12 20:19:01 +03:00
SYSTEMD_JOURNAL_SUPPORT="no"
APP_MACHINEID_SUPPORT="no"
AS_IF([test "$with_systemd" = "yes"],
2023-10-13 22:28:56 +03:00
PKG_CHECK_EXISTS(systemd >= 221, [SYSTEMD_MIN_VERSION=221 NOTIFYDBUS_SUPPORT="maybe" SYSTEMD_JOURNAL_SUPPORT="maybe"])
2023-10-12 20:19:01 +03:00
PKG_CHECK_EXISTS(systemd >= 234, [SYSTEMD_MIN_VERSION=234 APP_MACHINEID_SUPPORT="maybe"]))
2021-10-15 10:55:08 +03:00
2016-02-22 18:42:03 +03:00
################################################################################
2021-10-14 23:36:33 +03:00
dnl -- Build with systemd journaling when the header file is present
2023-10-12 20:19:01 +03:00
AS_IF([test "$SYSTEMD_JOURNAL_SUPPORT" != "no"],
AC_CHECK_HEADER([systemd/sd-journal.h], [SYSTEMD_JOURNAL_SUPPORT="yes"], [SYSTEMD_JOURNAL_SUPPORT="no"]))
2021-10-14 23:36:33 +03:00
AC_ARG_ENABLE(systemd-journal,
AS_HELP_STRING([--disable-systemd-journal],
[disable LVM systemd journaling]),
2022-11-27 17:35:06 +03:00
AS_IF([test "$enableval" = "yes" && test "$SYSTEMD_JOURNAL_SUPPORT" = "no"],
2023-10-12 20:19:01 +03:00
AC_MSG_ERROR([--enable-systemd-journal requires systemd/sd-journal.h and systemd >= 221. (--with-systemd=$with_systemd)]))
2021-10-14 23:36:33 +03:00
SYSTEMD_JOURNAL_SUPPORT=$enableval, [])
2023-10-12 20:19:01 +03:00
AC_MSG_CHECKING([whether to log to systemd journal])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$SYSTEMD_JOURNAL_SUPPORT])
2021-10-14 23:36:33 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$SYSTEMD_JOURNAL_SUPPORT" = "yes"],
2021-10-15 10:55:08 +03:00
AC_DEFINE([SYSTEMD_JOURNAL_SUPPORT], 1, [Define to 1 to include code that uses systemd journal.]))
2016-02-22 18:42:03 +03:00
2020-05-20 18:59:38 +03:00
################################################################################
2021-10-14 23:36:33 +03:00
dnl -- Build appmachineid when header file sd-id128.h is present
2023-10-12 20:19:01 +03:00
AS_IF([test "$APP_MACHINEID_SUPPORT" != "no"],
[AC_CHECK_HEADER([systemd/sd-id128.h], [APP_MACHINEID_SUPPORT="yes"], [APP_MACHINEID_SUPPORT="no"])])
2020-05-20 18:59:38 +03:00
AC_ARG_ENABLE(app-machineid,
2022-08-30 14:36:52 +03:00
AS_HELP_STRING([--disable-app-machineid],
2021-10-14 23:36:33 +03:00
[disable LVM system ID using app-specific machine-id]),
2022-11-27 17:35:06 +03:00
AS_IF([test "$enableval" = "yes" && test "$APP_MACHINEID_SUPPORT" = "no"],
2023-10-12 20:19:01 +03:00
AC_MSG_ERROR([--enable-app-machineid requires systemd/sd-id128.h and systemd >= 234. (--with-systemd=$with_systemd)]))
2021-10-14 23:36:33 +03:00
APP_MACHINEID_SUPPORT=$enableval, [])
2023-10-12 20:19:01 +03:00
AC_MSG_CHECKING([whether to support systemd appmachineid])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$APP_MACHINEID_SUPPORT])
2020-05-20 18:59:38 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$APP_MACHINEID_SUPPORT" = "yes"],
2021-10-15 10:55:08 +03:00
AC_DEFINE([APP_MACHINEID_SUPPORT], 1, [Define to 1 to include code that uses libsystemd machine-id apis.]))
2020-05-20 18:59:38 +03:00
2023-02-10 21:49:42 +03:00
################################################################################
dnl -- Support override for systemd-run path if they need to (NixOS builds)
AC_ARG_WITH(systemd-run,
AS_HELP_STRING([--with-systemd-run=PATH],
[systemd-run tool: [autodetect]]),
SYSTEMD_RUN_CMD=$withval, SYSTEMD_RUN_CMD="autodetect")
2023-03-01 01:13:00 +03:00
AS_IF([test "$SYSTEMD_RUN_CMD" = "autodetect"], [AC_PATH_TOOL(SYSTEMD_RUN_CMD, systemd-run)])
AC_MSG_CHECKING([for app running udev background service])
AS_IF([test -z "$SYSTEMD_RUN_CMD"], [SYSTEMD_RUN_CMD="/usr/bin/systemd-run"])
AC_MSG_RESULT([$SYSTEMD_RUN_CMD])
2023-02-10 21:49:42 +03:00
2015-03-05 23:00:44 +03:00
################################################################################
2013-11-14 17:03:24 +04:00
dnl -- Enable blkid wiping functionality
2023-02-08 16:39:43 +03:00
# TODO: possibly detect right version of blkid with BLKID_SUBLKS_FSINFO support
# so lvresize can check detected flag here
#
2017-06-09 13:56:55 +03:00
DEFAULT_USE_BLKID_WIPING=0
2023-10-12 20:19:01 +03:00
AC_ARG_ENABLE(blkid_wiping,
AS_HELP_STRING([--disable-blkid_wiping],
[disable libblkid detection of signatures when wiping and use native code instead]),
BLKID_WIPING=$enableval,
[AS_IF([test "$with_blkid" = "yes"], [BLKID_WIPING="maybe"], [BLKID_WIPING="no"])])
2023-02-08 16:39:43 +03:00
2023-10-12 20:19:01 +03:00
AS_IF([test "$BLKID_WIPING" != "no"], [
2023-02-10 23:31:07 +03:00
PKG_CHECK_MODULES([BLKID], [blkid >= 2.24], [
2023-10-12 20:19:01 +03:00
AC_CACHE_CHECK([for blkid.h defines BLKID_SUBLKS_FSINFO.],
[ac_cv_have_blkid_sublks_fsinfo],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <blkid/blkid.h>
2023-02-08 16:39:43 +03:00
#ifndef BLKID_SUBLKS_FSINFO
#error BLKID_SUBLKS_FSINFO is missing
2023-10-12 20:19:01 +03:00
#endif
])], [ac_cv_have_blkid_sublks_fsinfo="yes"], [ac_cv_have_blkid_sublks_fsinfo="no"])])
AC_IF_YES(ac_cv_have_blkid_sublks_fsinfo,
AC_DEFINE(HAVE_BLKID_SUBLKS_FSINFO, 1,
[Define if blkid.h has BLKID_SUBLKS_FSINFO]))
AS_IF([test "$with_blkid" = "no"], [BLKID_WIPING="error"], [
BLKID_WIPING="yes"
BLKID_PC="blkid"
DEFAULT_USE_BLKID_WIPING=1
# pkg_config --static does not really work ATM...
BLKID_STATIC_LIBS=$("$PKG_CONFIG" --static --libs blkid)
AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
])
], [AS_IF([test "$BLKID_WIPING" = "yes"], [BLKID_WIPING="error"], [BLKID_WIPING="no"])])
2023-02-08 16:39:43 +03:00
])
2023-10-12 20:19:01 +03:00
AS_IF([test "$BLKID_WIPING" = "error"],
[AC_MSG_ERROR([--enable-blkid_wiping requires blkid library >= 2.24. (--with-blkid=$with_blkid)])])
2017-06-09 13:56:55 +03:00
AC_MSG_CHECKING([whether to enable libblkid detection of signatures when wiping])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$BLKID_WIPING])
2015-06-23 16:20:51 +03:00
AC_DEFINE_UNQUOTED(DEFAULT_USE_BLKID_WIPING, [$DEFAULT_USE_BLKID_WIPING],
[Use blkid wiping by default.])
2013-11-14 17:03:24 +04:00
2009-07-31 15:49:53 +04:00
################################################################################
2023-07-02 17:41:34 +03:00
dnl -- Enable udev synchronization
AC_MSG_CHECKING([whether to enable synchronization with udev processing])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(udev_sync,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-udev_sync],
2023-07-02 17:41:34 +03:00
[enable synchronization with udev processing]),
2023-02-09 19:37:17 +03:00
UDEV_SYNC=$enableval, UDEV_SYNC="no")
AC_MSG_RESULT([$UDEV_SYNC])
2023-10-12 20:19:01 +03:00
AS_IF([test "$UDEV_SYNC" = "yes" && test "$with_udev" = "no"],
[AC_MSG_ERROR([--enable-udev_sync requires udev >= 143. (--with-udev=$with_udev)])])
2009-07-31 15:49:53 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$UDEV_SYNC" = "yes"], [
2011-04-22 15:56:41 +04:00
PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
2021-05-09 12:00:22 +03:00
UDEV_STATIC_LIBS=$("$PKG_CONFIG" --static --libs libudev)
2023-07-02 17:41:34 +03:00
AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronization with udev processing.])
2015-11-11 17:15:34 +03:00
AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
[Define to 1 if udev_device_get_is_initialized is available.]))
LIBS=$ac_check_lib_save_LIBS
2022-11-27 17:35:06 +03:00
])
2009-07-31 15:49:53 +04:00
dnl -- Enable udev rules
2023-07-02 17:41:34 +03:00
AC_MSG_CHECKING([whether to enable installation of udev rules required for synchronization])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(udev_rules,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-udev_rules],
2023-07-02 17:41:34 +03:00
[install rule files needed for udev synchronization]),
2010-07-08 16:02:48 +04:00
UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$UDEV_RULES])
2009-07-31 15:49:53 +04:00
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable executable path detection in udev rules])
2012-06-22 13:50:02 +04:00
AC_ARG_ENABLE(udev_rule_exec_detection,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-udev-rule-exec-detection],
2012-06-22 13:50:02 +04:00
[enable executable path detection in udev rules]),
2023-02-09 19:37:17 +03:00
UDEV_RULE_EXEC_DETECTION=$enableval, UDEV_RULE_EXEC_DETECTION="no")
AC_MSG_RESULT([$UDEV_RULE_EXEC_DETECTION])
2012-06-22 13:50:02 +04:00
dnl -- Check support for built-in blkid against target udev version
2022-11-27 17:35:06 +03:00
AS_IF([test "$UDEV_RULE" != "no"], [
PKG_CHECK_EXISTS([libudev >= 176], [
2023-02-09 19:37:17 +03:00
UDEV_HAS_BUILTIN_BLKID="yes"
2022-11-27 17:35:06 +03:00
], [
2023-02-09 19:37:17 +03:00
UDEV_HAS_BUILTIN_BLKID="no"
2022-11-27 17:35:06 +03:00
])
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether udev supports built-in blkid])
AC_MSG_RESULT([$UDEV_HAS_BUILTIN_BLKID])
2022-11-27 17:35:06 +03:00
])
2012-02-20 23:36:27 +04:00
2009-09-28 20:23:44 +04:00
################################################################################
dnl -- Compatible units suffix mode
AC_ARG_ENABLE(units-compat,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-units-compat],
2010-07-08 16:02:48 +04:00
[enable output compatibility with old versions that
that do not use KiB-style unit suffixes]),
2023-02-09 19:37:17 +03:00
UNITS_COMPAT=$enableval, UNITS_COMPAT="no")
2009-09-28 20:23:44 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$UNITS_COMPAT" = "yes"], [
2009-09-28 20:23:44 +04:00
AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
2022-11-27 17:35:06 +03:00
])
2009-09-28 20:23:44 +04:00
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Disable ioctl
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(ioctl,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-ioctl],
2014-04-29 14:44:32 +04:00
[disable ioctl calls to device-mapper in the kernel]),
2010-07-08 16:02:48 +04:00
DM_IOCTLS=$enableval)
2022-11-27 17:35:06 +03:00
AS_IF([test "$DM_IOCTLS" = "yes"],
2015-05-18 11:36:11 +03:00
[AC_DEFINE([DM_IOCTLS], 1, [Define to enable ioctls calls to kernel])])
2008-11-01 01:06:09 +03:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Disable O_DIRECT
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable O_DIRECT])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(o_direct,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-o_direct], [disable O_DIRECT]),
2010-07-08 16:02:48 +04:00
ODIRECT=$enableval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$ODIRECT])
2003-11-06 20:14:06 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$ODIRECT" = "yes"], [
2006-05-10 01:23:51 +04:00
AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2022-11-27 17:35:06 +03:00
])
2003-11-06 20:14:06 +03:00
2016-02-18 02:53:35 +03:00
################################################################################
dnl -- Enable D-Bus service
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to include Python D-Bus support])
2016-02-18 02:53:35 +03:00
AC_ARG_ENABLE(dbus-service,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-dbus-service], [install D-Bus support]),
2023-02-09 19:37:17 +03:00
BUILD_LVMDBUSD=$enableval, BUILD_LVMDBUSD="no")
AC_MSG_RESULT([$BUILD_LVMDBUSD])
2023-10-13 22:28:56 +03:00
################################################################################
dnl -- Build notifydbus
AC_ARG_ENABLE(notify-dbus,
[AS_HELP_STRING([--enable-notify-dbus], [enable LVM notification using dbus])],
[NOTIFYDBUS_SUPPORT=$enableval])
AS_IF([test "$NOTIFYDBUS_SUPPORT" = "maybe"],
[AS_IF([test "$BUILD_LVMDBUSD" = "yes"], [NOTIFYDBUS_SUPPORT="yes"], [NOTIFYDBUS_SUPPORT="no"])])
AS_IF([test "$NOTIFYDBUS_SUPPORT" = "yes"],
[AS_IF([test "$SYSTEMD_MIN_VERSION" -lt 221],
[AC_MSG_ERROR([--enable-notify-dbus requires systemd >= 221. (--with-systemd=$with_systemd)])])
AC_DEFINE([NOTIFYDBUS_SUPPORT], 1, [Define to 1 to include code that uses dbus notification.])])
AC_MSG_CHECKING([whether to build notifydbus])
AC_MSG_RESULT([$NOTIFYDBUS_SUPPORT])
################################################################################
dnl -- Look for libsystemd libraries if needed
AS_IF([test "$NOTIFYDBUS_SUPPORT" = "yes" || test "$SYSTEMD_JOURNAL_SUPPORT" = "yes" || test "$APP_MACHINEID_SUPPORT" = "yes"], [
PKG_CHECK_MODULES(LIBSYSTEMD, [libsystemd])
])
2016-02-18 02:53:35 +03:00
2012-10-12 05:08:47 +04:00
################################################################################
2018-06-08 11:38:05 +03:00
dnl -- Enable Python dbus library
2012-10-12 05:08:47 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LVMDBUSD" = "yes"], [
2016-02-18 02:53:35 +03:00
unset am_cv_pathless_PYTHON ac_cv_path_PYTHON am_cv_python_platform
unset am_cv_python_pythondir am_cv_python_version am_cv_python_pyexecdir
unset ac_cv_path_PYTHON_CONFIG ac_cv_path_ac_pt_PYTHON_CONFIG
2020-10-02 21:40:52 +03:00
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[ python3 python2 python dnl
2023-02-17 01:41:02 +03:00
python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 dnl
2020-10-02 21:40:52 +03:00
python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 ])
2016-02-18 02:53:35 +03:00
AM_PATH_PYTHON([3])
PYTHON3=$PYTHON
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$PYTHON3"], [
AC_MSG_ERROR([python3 is required for --enable-python3_bindings or --enable-dbus-service but cannot be found])
])
2016-02-18 02:53:35 +03:00
AC_PATH_TOOL(PYTHON3_CONFIG, python3-config)
2022-11-27 17:35:06 +03:00
AS_IF([test -z "$PYTHON3_CONFIG"], [
AC_MSG_ERROR([python3 headers are required for --enable-python3_bindings or --enable-dbus-service but cannot be found])
])
2016-02-18 02:53:35 +03:00
PYTHON3DIR=$pythondir
2023-02-17 01:41:02 +03:00
AS_IF([test "$PYTHON3_BINDINGS" = "yes"], [PYTHON_BINDINGS="yes"])
2012-10-12 05:08:47 +04:00
2016-02-18 02:53:35 +03:00
# To get this macro, install autoconf-archive package then run autoreconf
2022-08-30 14:36:52 +03:00
AX_PYTHON_MODULE([pyudev], [Required], python3)
AX_PYTHON_MODULE([dbus], [Required], python3)
2022-11-27 17:35:06 +03:00
])
2012-10-12 05:08:47 +04:00
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Enable pkg-config
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(pkgconfig,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]),
2023-02-09 19:37:17 +03:00
PKGCONFIG=$enableval, PKGCONFIG="no")
2008-07-09 13:59:42 +04:00
2010-04-10 01:42:48 +04:00
################################################################################
dnl -- Enable installation of writable files by user
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(write_install,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-write_install],
2010-07-08 16:02:48 +04:00
[install user writable files]),
2023-02-09 19:37:17 +03:00
WRITE_INSTALL=$enableval, WRITE_INSTALL="no")
2010-04-10 01:42:48 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Enable fsadm
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to install fsadm])
2021-09-24 19:06:28 +03:00
AC_ARG_ENABLE(fsadm, AS_HELP_STRING([--disable-fsadm], [disable fsadm]),
2010-07-08 16:02:48 +04:00
FSADM=$enableval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$FSADM])
2004-06-20 17:38:54 +04:00
2021-07-09 15:44:07 +03:00
################################################################################
2021-08-26 17:53:33 +03:00
dnl -- Enable lvm_import_vdo
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to install lvm_import_vdo])
2021-09-24 19:06:28 +03:00
AC_ARG_ENABLE(lvmimportvdo, AS_HELP_STRING([--disable-lvmimportvdo], [disable lvm_import_vdo]),
2021-08-23 15:02:42 +03:00
LVMIMPORTVDO=$enableval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$LVMIMPORTVDO])
2021-07-09 15:44:07 +03:00
2012-10-12 16:37:57 +04:00
################################################################################
dnl -- Enable blkdeactivate
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to install blkdeactivate])
2021-09-24 19:06:28 +03:00
AC_ARG_ENABLE(blkdeactivate, AS_HELP_STRING([--disable-blkdeactivate], [disable blkdeactivate]),
2012-10-12 16:37:57 +04:00
BLKDEACTIVATE=$enableval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$BLKDEACTIVATE])
2012-10-12 16:37:57 +04:00
2005-12-02 22:52:06 +03:00
################################################################################
dnl -- enable dmeventd handling
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to use dmeventd])
2021-09-24 19:06:28 +03:00
AC_ARG_ENABLE(dmeventd, AS_HELP_STRING([--enable-dmeventd],
2010-07-08 16:02:48 +04:00
[enable the device-mapper event daemon]),
2023-02-09 19:37:17 +03:00
BUILD_DMEVENTD=$enableval, BUILD_DMEVENTD="no")
AC_MSG_RESULT([$BUILD_DMEVENTD])
2008-11-01 01:06:09 +03:00
2005-12-02 22:52:06 +03:00
dnl -- dmeventd currently requires internal mirror support
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_DMEVENTD" = "yes"], [
2023-10-13 22:28:56 +03:00
AS_IF([test "$MIRRORS" != "internal"],
[AC_MSG_ERROR([--enable-dmeventd currently requires --with-mirrors=internal])])
AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])])
################################################################################
dnl -- Enable cmdlib
AC_ARG_ENABLE(cmdlib, [AS_HELP_STRING([--enable-cmdlib], [build shared command library])],
CMDLIB=$enableval, CMDLIB="maybe")
AS_IF([test "$BUILD_DMEVENTD" = "yes"],
[AS_IF([test "$CMDLIB" = "no"],
[AC_MSG_ERROR([--enable-dmeventd requires --enable-cmdlib to be used as well])],
[CMDLIB="yes"])])
AS_IF([test "$CMDLIB" != "yes"], [CMDLIB="no" LVM2CMD_LIB=], [LVM2CMD_LIB="-llvm2cmd"])
AC_MSG_CHECKING([whether to compile liblvm2cmd.so])
AC_MSG_RESULT([$CMDLIB])
AS_IF([test "$CMDLIB" == "yes" && test "$SHARED_LINK" = "no"],
[AC_MSG_ERROR([--enable-cmdlib requires dynamic linking.])])
2008-11-01 01:06:09 +03:00
2023-03-01 01:13:00 +03:00
################################################################################
dnl -- Check dmfilemapd
AC_MSG_CHECKING([whether to build dmfilemapd])
AC_ARG_ENABLE(dmfilemapd, AS_HELP_STRING([--enable-dmfilemapd],
[enable the dmstats filemap daemon]),
BUILD_DMFILEMAPD=$enableval, BUILD_DMFILEMAPD="no")
AC_MSG_RESULT([$BUILD_DMFILEMAPD])
dnl -- dmfilemapd requires FIEMAP
AS_IF([test "$BUILD_DMFILEMAPD" = "yes"],
2023-10-13 22:28:56 +03:00
[AC_CHECK_HEADER([linux/fiemap.h], [], [AC_MSG_ERROR(--enable-dmfilemapd requires fiemap.h)])
2023-03-01 01:13:00 +03:00
AC_DEFINE([DMFILEMAPD], 1, [Define to 1 to enable the device-mapper filemap daemon.])])
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- getline included in recent libc
2023-03-01 01:13:00 +03:00
AC_CHECK_LIB(c, getline,
[AC_DEFINE([HAVE_GETLINE], 1, [Define to 1 if getline is available.])])
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- canonicalize_file_name included in recent libc
AC_CHECK_LIB(c, canonicalize_file_name,
AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
[Define to 1 if canonicalize_file_name is available.]))
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Check for dlopen
2014-06-05 19:28:03 +04:00
AC_CHECK_LIB(dl, dlopen,
[AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
DL_LIBS="-ldl"
2023-02-09 19:37:17 +03:00
HAVE_LIBDL="yes"],
2014-06-05 19:28:03 +04:00
[DL_LIBS=
2023-02-09 19:37:17 +03:00
HAVE_LIBDL="no" ])
2003-03-24 21:08:53 +03:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Check for shared/static conflicts
2022-11-27 17:35:06 +03:00
AS_IF([( test "$LVM1" = "shared" || test "$POOL" = "shared" ) && test "$STATIC_LINK" = "yes"], [
2014-06-05 19:28:03 +04:00
AC_MSG_ERROR([Features cannot be 'shared' when building statically])
2022-11-27 17:35:06 +03:00
])
2004-04-07 18:08:22 +04:00
2015-08-18 17:21:19 +03:00
################################################################################
AC_CHECK_LIB(m, log10,
[M_LIBS="-lm"], hard_bailout)
2010-03-04 14:21:05 +03:00
################################################################################
2013-10-10 02:27:53 +04:00
AC_CHECK_LIB([pthread], [pthread_mutex_lock],
[PTHREAD_LIBS="-lpthread"], hard_bailout)
2010-03-04 14:21:05 +03:00
2008-06-13 18:37:18 +04:00
################################################################################
dnl -- Disable selinux
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable selinux support])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(selinux,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-selinux], [disable selinux support]),
2010-07-08 16:02:48 +04:00
SELINUX=$enableval)
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$SELINUX])
2008-06-13 18:37:18 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2006-04-19 19:33:07 +04:00
dnl -- Check for selinux
2022-11-27 17:35:06 +03:00
AS_IF([test "$SELINUX" = "yes"], [
2010-03-04 15:08:26 +03:00
AC_CHECK_LIB([sepol], [sepol_check_context], [
AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
2021-05-09 12:00:22 +03:00
SEPOL_LIBS="-lsepol"])
PKG_CHECK_EXISTS([libselinux],
[PKG_CHECK_MODULES([SELINUX], [libselinux],
[SELINUX_STATIC_LIBS=$("$PKG_CONFIG" --static --libs libselinux)])])
2006-04-19 19:33:07 +04:00
2010-03-04 15:08:26 +03:00
AC_CHECK_LIB([selinux], [is_selinux_enabled], [
AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
2010-12-13 13:43:56 +03:00
AC_CHECK_HEADERS([selinux/label.h])
2006-05-10 01:23:51 +04:00
AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
2021-05-09 12:00:22 +03:00
SELINUX_LIBS=${SELINUX_LIBS:--lselinux}
SELINUX_STATIC_LIBS=${SELINUX_STATIC_LIBS:-$SELINUX_LIBS $SEPOL_LIBS}
2010-05-11 12:48:43 +04:00
SELINUX_PC="libselinux"
2010-03-04 15:08:26 +03:00
HAVE_SELINUX=yes ], [
2004-07-03 22:21:13 +04:00
AC_MSG_WARN(Disabling selinux)
2010-03-04 15:08:26 +03:00
SELINUX_LIBS=
2021-05-09 12:00:22 +03:00
SELINUX_STATIC_LIBS=
2010-05-11 12:48:43 +04:00
SELINUX_PC=
2010-03-04 15:08:26 +03:00
HAVE_SELINUX=no ])
2022-11-27 17:35:06 +03:00
])
2004-04-05 20:29:37 +04:00
2020-10-02 19:39:19 +03:00
################################################################################
dnl -- Check BLKZEROOUT support
AC_CACHE_CHECK([for BLKZEROOUT in sys/ioctl.h.],
[ac_cv_have_blkzeroout],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include <sys/ioctl.h>
#include <linux/fs.h>
int bar(void) { return ioctl(0, BLKZEROOUT, 0); }]
2023-02-09 19:37:17 +03:00
)], [ac_cv_have_blkzeroout="yes"], [ac_cv_have_blkzeroout="no"])])
2020-10-02 19:39:19 +03:00
AC_ARG_ENABLE(blkzeroout,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--disable-blkzeroout],
2020-10-02 19:39:19 +03:00
[do not use BLKZEROOUT for device zeroing]),
2023-02-09 19:37:17 +03:00
BLKZEROOUT=$enableval, BLKZEROOUT="yes")
2020-10-02 19:39:19 +03:00
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to use BLKZEROOUT for device zeroing])
2022-11-27 17:35:06 +03:00
AS_IF([test "$BLKZEROOUT" = "yes"], [
2020-10-02 19:39:19 +03:00
AC_IF_YES(ac_cv_have_blkzeroout,
AC_DEFINE(HAVE_BLKZEROOUT, 1,
[Define if ioctl BLKZEROOUT can be used for device zeroing.]),
2023-02-09 19:37:17 +03:00
BLKZEROOUT="no")
2022-11-27 17:35:06 +03:00
])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$BLKZEROOUT])
2020-10-02 19:39:19 +03:00
2006-10-01 00:02:02 +04:00
################################################################################
dnl -- Check for realtime clock support
2017-08-01 13:41:45 +03:00
RT_LIBS=
HAVE_REALTIME=no
2022-11-27 17:35:06 +03:00
AS_IF([test "$REALTIME" = "yes"], [
2017-08-01 13:41:45 +03:00
AC_CHECK_FUNCS([clock_gettime], HAVE_REALTIME=yes)
2022-11-27 17:35:06 +03:00
AS_IF([test "$HAVE_REALTIME" != "yes"], [ # try again with -lrt
2017-08-01 13:41:45 +03:00
AC_CHECK_LIB([rt], [clock_gettime], RT_LIBS="-lrt"; HAVE_REALTIME=yes)])
2006-10-01 00:02:02 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$HAVE_REALTIME" = "yes"], [
2006-10-01 00:02:02 +04:00
AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
2022-11-27 17:35:06 +03:00
], [
2006-10-01 00:02:02 +04:00
AC_MSG_WARN(Disabling realtime clock)
2022-11-27 17:35:06 +03:00
])
])
2006-10-01 00:02:02 +04:00
2015-03-18 12:52:40 +03:00
dnl Check if the system has struct stat st_ctim.
AC_CACHE_CHECK([for struct stat has st_ctim.],
[ac_cv_stat_st_ctim],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include <sys/stat.h>
long bar(void) { struct stat s; return (long)(s.st_ctim.tv_sec + s.st_ctim.tv_nsec);}]
)], [ac_cv_stat_st_ctim=yes], [ac_cv_stat_st_ctim=no])])
AC_IF_YES(ac_cv_stat_st_ctim,
AC_DEFINE(HAVE_STAT_ST_CTIM, 1,
[Define if struct stat has a field st_ctim with timespec for ctime]))
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Check for getopt
2008-06-13 18:37:18 +04:00
AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
2003-04-15 17:24:42 +04:00
2020-09-26 22:32:55 +03:00
################################################################################
dnl -- Check for editline
2022-11-27 17:35:06 +03:00
AS_IF([test "$EDITLINE" = "yes"], [
2020-09-26 22:32:55 +03:00
PKG_CHECK_MODULES([EDITLINE], [libedit], [
AC_DEFINE([EDITLINE_SUPPORT], 1,
[Define to 1 to include the LVM editline shell.])], AC_MSG_ERROR(
2021-03-22 12:50:42 +03:00
[libedit could not be found which is required for the --enable-editline option.])
2020-09-26 22:32:55 +03:00
)
2022-11-27 17:35:06 +03:00
])
2020-09-26 22:32:55 +03:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
2022-11-27 17:35:06 +03:00
AS_IF([test "$READLINE" != "no"], [
2010-03-04 14:19:15 +03:00
lvm_saved_libs=$LIBS
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
READLINE_LIBS=$ac_cv_search_tgetent, [
2022-11-27 17:35:06 +03:00
AS_IF([test "$READLINE" = "yes"], [
2010-03-04 14:19:15 +03:00
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.])
2022-11-27 17:35:06 +03:00
])
])
2010-03-04 14:19:15 +03:00
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
2023-02-13 02:07:01 +03:00
READLINE="yes"
2010-03-04 14:19:15 +03:00
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=
2022-11-27 17:35:06 +03:00
AS_IF([test "$READLINE" = "yes"], [
2010-03-04 14:19:15 +03:00
AC_MSG_ERROR(
[GNU Readline could not be found which is required for the
2001-09-21 16:37:43 +04:00
--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
2010-03-04 14:19:15 +03:00
package as well (which may be called readline-devel or something similar).])
2022-11-27 17:35:06 +03:00
])
])
2010-03-04 14:19:15 +03:00
LIBS="$READLINE_LIBS $lvm_saved_libs"
AC_CHECK_FUNCS([rl_completion_matches])
LIBS=$lvm_saved_libs
2022-11-27 17:35:06 +03:00
])
2001-09-21 16:37:43 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Internationalisation stuff
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable internationalisation])
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(nls,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--enable-nls], [enable Native Language Support]),
2023-02-09 19:37:17 +03:00
INTL=$enableval, INTL="no")
AC_MSG_RESULT([$INTL])
2004-02-14 01:56:45 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$INTL" = "yes"], [
2008-11-01 01:06:09 +03:00
# FIXME - Move this - can be device-mapper too
2004-02-14 01:56:45 +03:00
INTL_PACKAGE="lvm2"
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(MSGFMT, msgfmt)
2015-05-18 11:36:11 +03:00
2015-05-20 10:07:49 +03:00
AS_IF([test -z "$MSGFMT"], [AC_MSG_ERROR([msgfmt not found in path $PATH])])
2004-02-14 01:56:45 +03:00
AC_ARG_WITH(localedir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-localedir=DIR],
2015-05-18 19:13:07 +03:00
[locale-dependent data [DATAROOTDIR/locale]]),
localedir=$withval, localedir=${localedir-'${datarootdir}/locale'})
2015-05-18 11:36:11 +03:00
AC_DEFINE_UNQUOTED([INTL_PACKAGE], ["$INTL_PACKAGE"], [Internalization package])
2015-05-18 19:13:07 +03:00
# double eval needed ${datarootdir} -> ${prefix}/share -> real path
AC_DEFINE_UNQUOTED([LOCALEDIR], ["$(eval echo $(eval echo $localedir))"], [Locale-dependent data])
2022-11-27 17:35:06 +03:00
])
2004-02-14 01:56:45 +03:00
2004-06-28 18:01:24 +04:00
################################################################################
2013-07-04 13:52:25 +04:00
dnl -- FIXME: need to switch to regular option here --sysconfdir
2004-04-14 21:39:55 +04:00
AC_ARG_WITH(confdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-confdir=DIR],
2014-10-30 19:13:05 +03:00
[configuration files in DIR [/etc]]),
2013-07-04 13:52:25 +04:00
CONFDIR=$withval, CONFDIR='/etc')
2015-02-13 22:10:10 +03:00
AC_DEFINE_UNQUOTED(DEFAULT_ETC_DIR, ["$CONFDIR"],
[Default system configuration directory.])
2004-04-14 22:00:23 +04:00
AC_ARG_WITH(staticdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-staticdir=DIR],
2014-10-30 19:13:05 +03:00
[static binaries in DIR [EPREFIX/sbin]]),
2014-11-20 10:22:34 +03:00
STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin')
2004-04-14 22:00:23 +04:00
2008-10-07 23:11:59 +04:00
AC_ARG_WITH(usrlibdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-usrlibdir=DIR],
2014-10-30 19:13:05 +03:00
[usrlib in DIR [PREFIX/lib]]),
2014-11-20 10:22:34 +03:00
usrlibdir=$withval, usrlibdir='${prefix}/lib')
2008-10-07 23:11:59 +04:00
AC_ARG_WITH(usrsbindir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-usrsbindir=DIR],
2014-10-30 19:13:05 +03:00
[usrsbin executables in DIR [PREFIX/sbin]]),
2014-11-20 10:22:34 +03:00
usrsbindir=$withval, usrsbindir='${prefix}/sbin')
2008-10-07 23:11:59 +04:00
lvresize: add new options and defaults for fs handling
The new option "--fs String" for lvresize/lvreduce/lvextend
controls the handling of file systems before/after resizing
the LV. --resizefs is the same as --fs resize.
The new option "--fsmode String" can be used to control
mounting and unmounting of the fs during resizing.
Possible --fs values:
checksize
Only applies to reducing size; does nothing for extend.
Check the fs size and reduce the LV if the fs is not using
the affected space, i.e. the fs does not need to be shrunk.
Fail the command without reducing the fs or LV if the fs is
using the affected space.
resize
Resize the fs using the fs-specific resize command.
This may include mounting, unmounting, or running fsck.
See --fsmode to control mounting behavior, and --nofsck to
disable fsck.
resize_fsadm
Use the old method of calling fsadm to handle the fs
(deprecated.) Warning: this option does not prevent lvreduce
from destroying file systems that are unmounted (or mounted
if prompts are skipped.)
ignore
Resize the LV without checking for or handling a file system.
Warning: using ignore when reducing the LV size may destroy the
file system.
Possible --fsmode values:
manage
Mount or unmount the fs as needed to resize the fs,
and attempt to restore the original mount state at the end.
nochange
Do not mount or unmount the fs. If mounting or unmounting
is required to resize the fs, then do not resize the fs or
the LV and fail the command.
offline
Unmount the fs if it is mounted, and resize the fs while it
is unmounted. If mounting is required to resize the fs,
then do not resize the fs or the LV and fail the command.
Notes on lvreduce:
When no --fs or --resizefs option is specified:
. lvextend default behavior is fs ignore.
. lvreduce default behavior is fs checksize
(includes activating the LV.)
With the exception of --fs resize_fsadm|ignore, lvreduce requires
the recent libblkid fields FSLASTBLOCK and FSBLOCKSIZE.
FSLASTBLOCK*FSBLOCKSIZE is the last byte used by the fs on the LV,
which determines if reducing the fs is necessary.
2022-06-14 23:20:21 +03:00
AC_ARG_WITH(libexecdir,
AS_HELP_STRING([--with-libexecdir=DIR],
[libexec executables in DIR [PREFIX/libexec]]),
libexecdir=$withval, libexecdir='${prefix}/libexec')
2009-07-31 15:49:53 +04:00
################################################################################
AC_ARG_WITH(udev_prefix,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-udev-prefix=UPREFIX],
2014-10-30 19:13:05 +03:00
[install udev rule files in UPREFIX [EPREFIX]]),
2014-11-20 10:22:34 +03:00
udev_prefix=$withval, udev_prefix='${exec_prefix}')
2009-07-31 15:49:53 +04:00
2009-07-31 17:31:53 +04:00
AC_ARG_WITH(udevdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-udevdir=DIR],
2014-10-30 19:13:05 +03:00
[udev rules in DIR [UPREFIX/lib/udev/rules.d]]),
2010-07-08 16:02:48 +04:00
udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
2009-07-31 15:49:53 +04:00
2012-02-13 17:02:47 +04:00
################################################################################
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,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
2022-11-27 17:35:06 +03:00
[systemd service files in DIR]))
2012-02-13 17:02:47 +04:00
2023-03-01 01:13:00 +03:00
AS_IF([test -z "$with_systemdsystemunitdir"],
[PKG_CHECK_VAR([systemdsystemunitdir], [systemd], [systemdsystemunitdir], [],
[systemdsystemunitdir='${exec_prefix}/lib/systemd/system'])],
[systemdsystemunitdir="$with_systemdsystemunitdir"])
2012-02-13 17:02:47 +04:00
2023-03-01 01:13:00 +03:00
PKG_CHECK_VAR([systemdutildir], [systemd], [systemdutildir], [],
[systemdutildir='${exec_prefix}/lib/systemd'])
2012-07-31 18:46:24 +04:00
2004-07-03 22:21:13 +04:00
################################################################################
2012-02-22 21:55:10 +04:00
AC_ARG_WITH(tmpfilesdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-tmpfilesdir=DIR],
2014-10-30 19:13:05 +03:00
[install configuration files for management of volatile files and directories in DIR [PREFIX/lib/tmpfiles.d]]),
2014-11-20 10:22:34 +03:00
tmpfilesdir=$withval, tmpfilesdir='${prefix}/lib/tmpfiles.d')
2024-02-08 16:58:16 +03:00
################################################################################
dnl - Where to look for modules.builtin file for a kernel - most typically in /lib/modules/
AC_MSG_CHECKING([for kernel modules directory])
AC_ARG_WITH(modulesdir,
AS_HELP_STRING([--with-modulesdir=DIR],
[Dir to look for file `uname -r`/modules.builtin [/lib/modules]]),
[modulesdir=$withval], [modulesdir="/lib/modules"])
AC_DEFINE_UNQUOTED(MODULES_PATH, ["$modulesdir"], [The path to kernel modules.])
AC_MSG_RESULT([$modulesdir])
2012-02-22 21:55:10 +04:00
################################################################################
2004-07-03 22:21:13 +04:00
dnl -- Ensure additional headers required
2022-11-27 17:35:06 +03:00
AS_IF([test "$READLINE" = "yes"], [
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS(readline/readline.h readline/history.h,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable readline])
AC_MSG_RESULT([$READLINE])
2004-07-03 22:21:13 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$EDITLINE" = "yes"], [
2021-03-22 12:50:42 +03:00
AC_CHECK_HEADERS(editline/readline.h,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([whether to enable editline])
AC_MSG_RESULT([$EDITLINE])
2020-09-26 22:32:55 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_CMIRRORD" = "yes"], [
2015-07-27 16:26:56 +03:00
AC_CHECK_FUNCS(atexit,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2015-07-27 16:26:56 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LVMLOCKD" = "yes"], [
AS_IF([test "$HAVE_REALTIME" != "yes"], [
AC_MSG_ERROR([Realtime clock support is mandatory for lvmlockd.])])
2017-08-01 13:41:45 +03:00
AC_CHECK_FUNCS(strtoull,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2015-07-27 16:26:56 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_LVMPOLLD" = "yes"], [
2015-07-27 16:26:56 +03:00
AC_CHECK_FUNCS(strpbrk,,hard_bailout)
AC_FUNC_STRERROR_R
2022-11-27 17:35:06 +03:00
])
2015-07-27 16:26:56 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_DMEVENTD" = "yes"], [
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS(arpa/inet.h,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2010-07-06 02:23:15 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$HAVE_LIBDL" = "yes"], [
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS(dlfcn.h,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2004-07-03 22:21:13 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$INTL" = "yes"], [
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS(libintl.h,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2004-07-03 22:21:13 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$UDEV_SYNC" = "yes"], [
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,hard_bailout)
2022-11-27 17:35:06 +03:00
])
2009-07-31 15:49:53 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_DMFILEMAPD" = "yes"], [
daemons: add dmfilemapd
Add a daemon that can be launched to monitor a group of regions
corresponding to the extents of a file, and to update the regions as the
file's allocation changes.
The daemon is intended to be started from a library interface, but can
also be run from the command line:
dmfilemapd <fd> <group_id> <path> <mode> [<foreground>[<log_level>]]
Where fd is a file descriptor open on the mapped file, group_id is the
group identifier of the mapped group and mode is either "inode" or
"path". E.g.:
# dmfilemapd 3 0 vm.img inode 1 3 3<vm.img
...
If foreground is non-zero, the daemon will not fork to run in the
background. If verbose is non-zero, libdm and daemon log messages will
be printed.
It is possible for the group identifier to change when regions are
re-mapped: this occurs when the group leader is deleted (regroup=1 in
dm_stats_update_regions_from_fd()), and another region is created before
the daemon has a chance to recreate the leader region.
The operation is inherently racey since there is currently no way to
atomically move or resize a dm_stats region while retaining its
region_id.
Detect this condition and update the group_id value stored in the
filemap monitor.
A function is also provided in the the stats API to launch the filemap
monitoring daemon:
int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
dm_filemapd_mode_t mode, unsigned foreground,
unsigned verbose);
This carries out the first fork and execs dmfilemapd with the arguments
specified.
A dm_filemapd_mode_t value is specified by the mode argument: either
DM_FILEMAPD_FOLLOW_INODE, or DM_FILEMAPD_FOLLOW_PATH. A helper function,
dm_filemapd_mode_from_string(), is provided to parse a string containing
a valid mode name into the appropriate dm_filemapd_mode_t value.
2016-12-15 23:10:27 +03:00
AC_CHECK_HEADERS([sys/inotify.h],,hard_bailout)
2022-11-27 17:35:06 +03:00
])
daemons: add dmfilemapd
Add a daemon that can be launched to monitor a group of regions
corresponding to the extents of a file, and to update the regions as the
file's allocation changes.
The daemon is intended to be started from a library interface, but can
also be run from the command line:
dmfilemapd <fd> <group_id> <path> <mode> [<foreground>[<log_level>]]
Where fd is a file descriptor open on the mapped file, group_id is the
group identifier of the mapped group and mode is either "inode" or
"path". E.g.:
# dmfilemapd 3 0 vm.img inode 1 3 3<vm.img
...
If foreground is non-zero, the daemon will not fork to run in the
background. If verbose is non-zero, libdm and daemon log messages will
be printed.
It is possible for the group identifier to change when regions are
re-mapped: this occurs when the group leader is deleted (regroup=1 in
dm_stats_update_regions_from_fd()), and another region is created before
the daemon has a chance to recreate the leader region.
The operation is inherently racey since there is currently no way to
atomically move or resize a dm_stats region while retaining its
region_id.
Detect this condition and update the group_id value stored in the
filemap monitor.
A function is also provided in the the stats API to launch the filemap
monitoring daemon:
int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
dm_filemapd_mode_t mode, unsigned foreground,
unsigned verbose);
This carries out the first fork and execs dmfilemapd with the arguments
specified.
A dm_filemapd_mode_t value is specified by the mode argument: either
DM_FILEMAPD_FOLLOW_INODE, or DM_FILEMAPD_FOLLOW_PATH. A helper function,
dm_filemapd_mode_from_string(), is provided to parse a string containing
a valid mode name into the appropriate dm_filemapd_mode_t value.
2016-12-15 23:10:27 +03:00
2005-10-17 21:56:27 +04:00
################################################################################
2018-01-29 18:20:53 +03:00
AC_PATH_TOOL(MODPROBE_CMD, modprobe, [], [$PATH_SBIN])
2005-10-17 21:56:27 +04:00
2022-11-27 17:35:06 +03:00
AS_IF([test -n "$MODPROBE_CMD"], [
2006-05-10 01:23:51 +04:00
AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
2022-11-27 17:35:06 +03:00
])
2005-10-17 21:56:27 +04:00
2017-10-25 17:49:17 +03:00
SYSCONFDIR="$(eval echo $(eval echo $sysconfdir))"
2010-06-07 18:31:59 +04:00
2017-10-25 17:49:17 +03:00
SBINDIR="$(eval echo $(eval echo $sbindir))"
LVM_PATH="$SBINDIR/lvm"
2011-09-25 00:50:35 +04:00
AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
2010-06-03 17:50:26 +04:00
2018-08-30 13:59:59 +03:00
LVMCONFIG_PATH="$SBINDIR/lvmconfig"
2018-06-07 18:15:04 +03:00
AC_DEFINE_UNQUOTED(LVMCONFIG_PATH, ["$LVMCONFIG_PATH"], [Path to lvmconfig binary.])
2017-10-25 17:49:17 +03:00
USRSBINDIR="$(eval echo $(eval echo $usrsbindir))"
2010-06-03 17:50:26 +04:00
2017-10-25 17:49:17 +03:00
FSADM_PATH="$SBINDIR/fsadm"
2017-04-08 20:43:20 +03:00
AC_DEFINE_UNQUOTED(FSADM_PATH, ["$FSADM_PATH"], [Path to fsadm binary.])
2021-08-23 15:02:42 +03:00
LVMIMPORTVDO_PATH="$SBINDIR/lvm_import_vdo"
AC_DEFINE_UNQUOTED(LVMIMPORTVDO_PATH, ["$LVMIMPORTVDO_PATH"], [Path to lvm_import_vdo script.])
2021-07-09 15:44:07 +03:00
lvresize: add new options and defaults for fs handling
The new option "--fs String" for lvresize/lvreduce/lvextend
controls the handling of file systems before/after resizing
the LV. --resizefs is the same as --fs resize.
The new option "--fsmode String" can be used to control
mounting and unmounting of the fs during resizing.
Possible --fs values:
checksize
Only applies to reducing size; does nothing for extend.
Check the fs size and reduce the LV if the fs is not using
the affected space, i.e. the fs does not need to be shrunk.
Fail the command without reducing the fs or LV if the fs is
using the affected space.
resize
Resize the fs using the fs-specific resize command.
This may include mounting, unmounting, or running fsck.
See --fsmode to control mounting behavior, and --nofsck to
disable fsck.
resize_fsadm
Use the old method of calling fsadm to handle the fs
(deprecated.) Warning: this option does not prevent lvreduce
from destroying file systems that are unmounted (or mounted
if prompts are skipped.)
ignore
Resize the LV without checking for or handling a file system.
Warning: using ignore when reducing the LV size may destroy the
file system.
Possible --fsmode values:
manage
Mount or unmount the fs as needed to resize the fs,
and attempt to restore the original mount state at the end.
nochange
Do not mount or unmount the fs. If mounting or unmounting
is required to resize the fs, then do not resize the fs or
the LV and fail the command.
offline
Unmount the fs if it is mounted, and resize the fs while it
is unmounted. If mounting is required to resize the fs,
then do not resize the fs or the LV and fail the command.
Notes on lvreduce:
When no --fs or --resizefs option is specified:
. lvextend default behavior is fs ignore.
. lvreduce default behavior is fs checksize
(includes activating the LV.)
With the exception of --fs resize_fsadm|ignore, lvreduce requires
the recent libblkid fields FSLASTBLOCK and FSBLOCKSIZE.
FSLASTBLOCK*FSBLOCKSIZE is the last byte used by the fs on the LV,
which determines if reducing the fs is necessary.
2022-06-14 23:20:21 +03:00
LIBEXECDIR="$(eval echo $(eval echo $libexecdir))"
LVRESIZE_FS_HELPER_PATH="$LIBEXECDIR/lvresize_fs_helper"
AC_DEFINE_UNQUOTED(LVRESIZE_FS_HELPER_PATH, ["$LVRESIZE_FS_HELPER_PATH"], [Path to lvresize_fs_helper script.])
2004-06-28 18:01:24 +04:00
################################################################################
2008-11-01 01:06:09 +03:00
dnl -- dmeventd pidfile and executable path
2023-02-22 16:11:50 +03:00
AC_ARG_WITH(dmeventd-pidfile,
AS_HELP_STRING([--with-dmeventd-pidfile=PATH],
[dmeventd pidfile [PID_DIR/dmeventd.pid]]),
DMEVENTD_PIDFILE=$withval,
DMEVENTD_PIDFILE="$DEFAULT_PID_DIR/dmeventd.pid")
AC_ARG_WITH(dmeventd-path,
AS_HELP_STRING([--with-dmeventd-path=PATH],
[dmeventd path [EPREFIX/sbin/dmeventd]]),
DMEVENTD_PATH=$withval,
DMEVENTD_PATH="$SBINDIR/dmeventd")
2023-09-25 16:48:06 +03:00
AC_ARG_WITH(dmeventd-exit-on-path,
AS_HELP_STRING([--with-dmeventd-exit-on-path=PATH],
[Default path to exit-on file in dmeventd [/run/nologin]]),
DEFAULT_DMEVENTD_EXIT_ON_PATH=$withval,
DEFAULT_DMEVENTD_EXIT_ON_PATH="/run/nologin")
2023-02-22 16:11:50 +03:00
2022-11-27 17:35:06 +03:00
AS_IF([test "$BUILD_DMEVENTD" = "yes"], [
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
[Path to dmeventd pidfile.])
AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"],
[Path to dmeventd binary.])
2023-09-25 16:48:06 +03:00
AC_DEFINE_UNQUOTED(DEFAULT_DMEVENTD_EXIT_ON_PATH, ["$DEFAULT_DMEVENTD_EXIT_ON_PATH"],
[Path to exit-on dmeventd file.])
2022-11-27 17:35:06 +03:00
])
2008-11-01 01:06:09 +03:00
2010-05-20 17:47:21 +04:00
################################################################################
dnl -- various defaults
2013-07-04 13:52:25 +04:00
dnl -- FIXME: need to switch to regular option here --sysconfdir
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-system-dir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-system-dir=DIR],
2014-10-30 19:13:05 +03:00
[default LVM system directory [/etc/lvm]]),
2013-07-04 13:52:25 +04:00
DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm")
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"],
[Path to LVM system directory.])
2010-05-20 17:47:21 +04:00
2013-06-25 14:26:40 +04:00
AC_ARG_WITH(default-profile-subdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-profile-subdir=SUBDIR],
2014-10-30 19:13:05 +03:00
[default configuration profile subdir [profile]]),
2023-02-09 19:37:17 +03:00
DEFAULT_PROFILE_SUBDIR=$withval, DEFAULT_PROFILE_SUBDIR="profile")
2013-06-25 14:26:40 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_PROFILE_SUBDIR, ["$DEFAULT_PROFILE_SUBDIR"],
[Name of default configuration profile subdirectory.])
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-archive-subdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-archive-subdir=SUBDIR],
2014-10-30 19:13:05 +03:00
[default metadata archive subdir [archive]]),
2023-02-09 19:37:17 +03:00
DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR="archive")
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"],
[Name of default metadata archive subdirectory.])
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-backup-subdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-backup-subdir=SUBDIR],
2014-10-30 19:13:05 +03:00
[default metadata backup subdir [backup]]),
2023-02-09 19:37:17 +03:00
DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR="backup")
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"],
[Name of default metadata backup subdirectory.])
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-cache-subdir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-cache-subdir=SUBDIR],
2014-10-30 19:13:05 +03:00
[default metadata cache subdir [cache]]),
2023-02-09 19:37:17 +03:00
DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR="cache")
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"],
[Name of default metadata cache subdirectory.])
2010-05-20 17:47:21 +04:00
2017-10-25 17:49:17 +03:00
# Select default system locking dir, prefer /run/lock over /var/lock
DEFAULT_SYS_LOCK_DIR="$RUN_DIR/lock"
test -d "$DEFAULT_SYS_LOCK_DIR" || DEFAULT_SYS_LOCK_DIR="/var/lock"
# Support configurable locking subdir for lvm
2023-03-01 01:13:00 +03:00
AC_MSG_CHECKING([for default lock directory])
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-locking-dir,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-default-locking-dir=DIR],
2016-04-21 00:15:00 +03:00
[default locking directory [autodetect_lock_dir/lvm]]),
2023-03-01 01:13:00 +03:00
[DEFAULT_LOCK_DIR=$withval], [DEFAULT_LOCK_DIR="$DEFAULT_SYS_LOCK_DIR/lvm"])
AC_MSG_RESULT([$DEFAULT_LOCK_DIR])
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
[Name of default locking directory.])
2010-05-20 17:47:21 +04:00
2024-04-15 14:36:35 +03:00
# No --with configure setting, but store in the main configure.h
AC_DEFINE_UNQUOTED(DEFAULT_PROC_DIR, ["/proc"], [Path to /proc.])
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- which kernel interface to use (ioctl only)
2023-02-09 19:37:17 +03:00
AC_MSG_CHECKING([for kernel interface choice])
2008-11-01 01:06:09 +03:00
AC_ARG_WITH(interface,
2021-09-24 19:06:28 +03:00
AS_HELP_STRING([--with-interface=IFACE],
2014-10-30 19:13:05 +03:00
[choose kernel interface (ioctl) [ioctl]]),
2023-02-09 19:37:17 +03:00
interface=$withval, interface="ioctl")
2023-02-22 16:11:50 +03:00
AS_IF([test "$interface" != "ioctl"],
[AC_MSG_ERROR([--with-interface=ioctl required. fs no longer supported.])])
2023-02-09 19:37:17 +03:00
AC_MSG_RESULT([$interface])
2008-11-01 01:06:09 +03:00
################################################################################
2023-02-09 19:37:17 +03:00
read DM_LIB_VERSION < "$srcdir"/VERSION_DM 2>/dev/null || DM_LIB_VERSION="Unknown"
2015-09-07 14:58:54 +03:00
AC_DEFINE_UNQUOTED(DM_LIB_VERSION, "$DM_LIB_VERSION", [Library version])
2008-11-01 04:43:31 +03:00
2023-02-22 16:11:50 +03:00
DM_LIB_PATCHLEVEL=$($AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}' "$srcdir"/VERSION_DM)
2008-11-01 23:48:09 +03:00
2015-09-07 14:58:54 +03:00
read VER < "$srcdir"/VERSION 2>/dev/null || VER=Unknown
2002-01-17 19:39:24 +03:00
2015-09-07 14:58:54 +03:00
LVM_VERSION=\"$VER\"
2023-02-09 19:37:17 +03:00
LVM_RELEASE_DATE="\"$(echo $VER | $SED 's/.* (//;s/).*//')\""
VER=$(echo "$VER" | $AWK '{print $1}')
LVM_RELEASE="\"$(echo "$VER" | $AWK -F '-' '{print $2}')\""
VER=$(echo "$VER" | $AWK -F '-' '{print $1}')
LVM_MAJOR=$(echo "$VER" | $AWK -F '.' '{print $1}')
LVM_MINOR=$(echo "$VER" | $AWK -F '.' '{print $2}')
LVM_PATCHLEVEL=$(echo "$VER" | $AWK -F '[[(.]]' '{print $3}')
LVM_LIBAPI=$(echo "$VER" | $AWK -F '[[()]]' '{print $2}')
2009-02-23 01:11:58 +03:00
2017-03-23 04:00:49 +03:00
AC_DEFINE_UNQUOTED(LVM_CONFIGURE_LINE, "$CONFIGURE_LINE", [configure command line used])
2023-02-22 16:11:50 +03:00
################################################################################
# Allow users to override default location for libaio
# there seems to be no pkg-config support available
AIO_CFLAGS=${AIO_CFLAGS:-}
AIO_LIBS=${AIO_LIBS:--laio}
AC_ARG_VAR([AIO_CFLAGS], [C compiler flags for AIO])
AC_ARG_VAR([AIO_LIBS], [linker flags for AIO])
2021-10-14 23:36:33 +03:00
AC_ARG_VAR([READLINE_CFLAGS], [C compiler flags for readline])
AC_ARG_VAR([READLINE_LIBS], [linker flags for readline])
2004-06-28 18:01:24 +04:00
################################################################################
2010-04-30 17:58:08 +04:00
AC_SUBST(AWK)
2023-02-22 16:11:50 +03:00
AC_SUBST(BLKDEACTIVATE)
2013-11-14 17:03:24 +04:00
AC_SUBST(BLKID_PC)
2021-05-09 12:00:22 +03:00
AC_SUBST(BLKID_STATIC_LIBS)
2009-08-29 00:51:40 +04:00
AC_SUBST(BUILD_CMIRRORD)
2008-06-13 18:37:18 +04:00
AC_SUBST(BUILD_DMEVENTD)
2023-02-22 16:11:50 +03:00
AC_SUBST(BUILD_DMFILEMAPD)
2015-07-06 18:42:11 +03:00
AC_SUBST(BUILD_LOCKDDLM)
2019-03-20 21:20:26 +03:00
AC_SUBST(BUILD_LOCKDDLM_CONTROL)
2023-02-11 00:53:43 +03:00
AC_SUBST(BUILD_LOCKDIDM)
2023-02-22 16:11:50 +03:00
AC_SUBST(BUILD_LOCKDSANLOCK)
AC_SUBST(BUILD_LVMDBUSD)
AC_SUBST(BUILD_LVMLOCKD)
AC_SUBST(BUILD_LVMPOLLD)
2014-01-27 15:27:16 +04:00
AC_SUBST(CACHE)
2023-02-22 16:11:50 +03:00
AC_SUBST(CACHE_CHECK_CMD)
AC_SUBST(CACHE_DUMP_CMD)
AC_SUBST(CACHE_REPAIR_CMD)
AC_SUBST(CACHE_RESTORE_CMD)
2003-04-15 17:24:42 +04:00
AC_SUBST(CFLAGS)
2008-06-13 18:37:18 +04:00
AC_SUBST(CFLOW_CMD)
2016-02-18 02:53:35 +03:00
AC_SUBST(CHMOD)
2004-03-26 17:17:14 +03:00
AC_SUBST(CLDFLAGS)
AC_SUBST(CLDNOWHOLEARCHIVE)
2008-06-13 18:37:18 +04:00
AC_SUBST(CLDWHOLEARCHIVE)
AC_SUBST(CMDLIB)
2023-02-22 16:11:50 +03:00
AC_SUBST(CMIRRORD_PIDFILE)
2009-02-26 01:41:12 +03:00
AC_SUBST(CONFDIR)
2008-06-13 18:37:18 +04:00
AC_SUBST(COPTIMISE_FLAG)
2023-02-22 16:11:50 +03:00
AC_SUBST(CPPFLAGS)
2008-06-13 18:37:18 +04:00
AC_SUBST(CSCOPE_CMD)
2002-12-20 02:25:55 +03:00
AC_SUBST(DEBUG)
2010-05-20 17:47:21 +04:00
AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
AC_SUBST(DEFAULT_BACKUP_SUBDIR)
AC_SUBST(DEFAULT_CACHE_SUBDIR)
2012-06-21 16:41:52 +04:00
AC_SUBST(DEFAULT_DM_RUN_DIR)
2023-09-25 16:48:06 +03:00
AC_SUBST(DEFAULT_DMEVENTD_EXIT_ON_PATH)
2024-04-09 15:50:52 +03:00
AC_SUBST(DEFAULT_EVENT_ACTIVATION)
2014-10-31 01:38:02 +03:00
AC_SUBST(DEFAULT_LOCK_DIR)
AC_SUBST(DEFAULT_MIRROR_SEGTYPE)
2014-04-23 16:31:42 +04:00
AC_SUBST(DEFAULT_PID_DIR)
2024-04-15 14:36:35 +03:00
AC_SUBST(DEFAULT_PROC_DIR)
2014-10-31 01:38:02 +03:00
AC_SUBST(DEFAULT_PROFILE_SUBDIR)
AC_SUBST(DEFAULT_RAID10_SEGTYPE)
2010-07-31 04:43:41 +04:00
AC_SUBST(DEFAULT_RUN_DIR)
2014-10-31 01:38:02 +03:00
AC_SUBST(DEFAULT_SPARSE_SEGTYPE)
AC_SUBST(DEFAULT_SYS_DIR)
2017-10-25 17:49:17 +03:00
AC_SUBST(DEFAULT_SYS_LOCK_DIR)
2015-06-23 16:20:51 +03:00
AC_SUBST(DEFAULT_USE_BLKID_WIPING)
2022-10-24 19:03:42 +03:00
AC_SUBST(DEFAULT_USE_DEVICES_FILE)
2015-03-05 23:00:44 +03:00
AC_SUBST(DEFAULT_USE_LVMLOCKD)
2023-02-22 16:11:50 +03:00
AC_SUBST(DEFAULT_USE_LVMPOLLD)
2003-01-09 01:44:07 +03:00
AC_SUBST(DEVMAPPER)
2010-03-04 15:10:40 +03:00
AC_SUBST(DL_LIBS)
2010-08-17 02:54:35 +04:00
AC_SUBST(DMEVENTD_PATH)
2023-02-22 16:11:50 +03:00
AC_SUBST(DMEVENTD_PIDFILE)
2008-11-01 23:48:09 +03:00
AC_SUBST(DM_LIB_PATCHLEVEL)
2011-11-15 01:30:35 +04:00
AC_SUBST(ELDFLAGS)
2008-06-13 18:37:18 +04:00
AC_SUBST(FSADM)
2017-04-13 02:38:46 +03:00
AC_SUBST(FSADM_PATH)
2021-04-19 12:24:16 +03:00
AC_SUBST(INTEGRITY)
2008-06-13 18:37:18 +04:00
AC_SUBST(INTL)
AC_SUBST(JOBS)
AC_SUBST(LDDEPS)
AC_SUBST(LIBS)
AC_SUBST(LIB_SUFFIX)
2023-02-22 16:11:50 +03:00
AC_SUBST(localedir)
2023-10-13 22:28:56 +03:00
AC_SUBST(LVM2CMD_LIB)
2023-02-22 16:11:50 +03:00
AC_SUBST(LVMIMPORTVDO)
AC_SUBST(LVMIMPORTVDO_PATH)
AC_SUBST(LVMLOCKD_PIDFILE)
AC_SUBST(LVMPOLLD_PIDFILE)
2009-07-23 00:01:28 +04:00
AC_SUBST(LVM_LIBAPI)
2009-02-23 01:11:58 +03:00
AC_SUBST(LVM_MAJOR)
AC_SUBST(LVM_MINOR)
AC_SUBST(LVM_PATCHLEVEL)
2011-09-25 00:50:35 +04:00
AC_SUBST(LVM_PATH)
2009-02-23 01:11:58 +03:00
AC_SUBST(LVM_RELEASE)
AC_SUBST(LVM_RELEASE_DATE)
2023-02-22 16:11:50 +03:00
AC_SUBST(LVM_VERSION)
AC_SUBST(LVRESIZE_FS_HELPER_PATH)
2014-06-05 19:26:53 +04:00
AC_SUBST(MANGLING)
2008-06-13 18:37:18 +04:00
AC_SUBST(MIRRORS)
2011-08-03 02:07:20 +04:00
AC_SUBST(MSGFMT)
2023-02-22 16:11:50 +03:00
AC_SUBST(M_LIBS)
2010-11-05 19:18:38 +03:00
AC_SUBST(OCF)
2011-01-10 16:00:53 +03:00
AC_SUBST(OCFDIR)
2016-09-15 15:59:52 +03:00
AC_SUBST(ODIRECT)
2008-06-13 18:37:18 +04:00
AC_SUBST(PKGCONFIG)
2010-03-04 14:21:05 +03:00
AC_SUBST(PTHREAD_LIBS)
2016-02-18 02:53:35 +03:00
AC_SUBST(PYTHON2)
AC_SUBST(PYTHON2DIR)
2023-02-22 16:11:50 +03:00
AC_SUBST(PYTHON3)
2016-02-18 02:53:35 +03:00
AC_SUBST(PYTHON3DIR)
2017-08-01 13:41:45 +03:00
AC_SUBST(RT_LIBS)
2017-10-25 17:49:17 +03:00
AC_SUBST(SBINDIR)
2009-10-05 16:11:30 +04:00
AC_SUBST(SELINUX_LIBS)
2010-05-11 12:48:43 +04:00
AC_SUBST(SELINUX_PC)
2021-05-09 12:00:22 +03:00
AC_SUBST(SELINUX_STATIC_LIBS)
2023-09-22 09:47:38 +03:00
AC_SUBST(SHARED_LINK)
2023-02-22 16:11:50 +03:00
AC_SUBST(SILENT_RULES)
2008-06-13 18:37:18 +04:00
AC_SUBST(SNAPSHOTS)
2004-04-14 22:00:23 +04:00
AC_SUBST(STATICDIR)
2023-02-22 16:41:08 +03:00
AC_SUBST(STATIC_LDFLAGS)
2008-06-13 18:37:18 +04:00
AC_SUBST(STATIC_LINK)
2023-02-22 16:11:50 +03:00
AC_SUBST(SYSCONFDIR)
AC_SUBST(SYSTEMD_RUN_CMD)
2015-07-14 21:27:31 +03:00
AC_SUBST(TESTSUITE_DATA)
2011-08-24 12:27:49 +04:00
AC_SUBST(THIN)
2012-03-14 21:09:00 +04:00
AC_SUBST(THIN_CHECK_CMD)
2013-07-31 16:38:10 +04:00
AC_SUBST(THIN_DUMP_CMD)
AC_SUBST(THIN_REPAIR_CMD)
2014-05-27 01:28:03 +04:00
AC_SUBST(THIN_RESTORE_CMD)
2023-02-22 16:11:50 +03:00
AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
2010-05-11 12:48:43 +04:00
AC_SUBST(UDEV_PC)
2009-07-31 15:49:53 +04:00
AC_SUBST(UDEV_RULES)
2012-06-22 13:50:02 +04:00
AC_SUBST(UDEV_RULE_EXEC_DETECTION)
2021-05-09 12:00:22 +03:00
AC_SUBST(UDEV_STATIC_LIBS)
2023-02-22 16:11:50 +03:00
AC_SUBST(UDEV_SYNC)
2015-09-07 14:57:38 +03:00
AC_SUBST(USE_TRACKING)
2017-10-25 17:49:17 +03:00
AC_SUBST(USRSBINDIR)
2015-02-12 17:29:58 +03:00
AC_SUBST(VALGRIND_POOL)
2018-06-29 14:38:18 +03:00
AC_SUBST(VDO)
AC_SUBST(VDO_FORMAT_CMD)
AC_SUBST(VDO_INCLUDE)
AC_SUBST(VDO_LIB)
2021-04-19 12:24:16 +03:00
AC_SUBST(WRITECACHE)
2010-04-10 01:42:48 +04:00
AC_SUBST(WRITE_INSTALL)
2008-11-01 01:06:09 +03:00
AC_SUBST(interface)
AC_SUBST(kerneldir)
AC_SUBST(kernelvsn)
2023-02-22 16:11:50 +03:00
AC_SUBST(libexecdir)
AC_SUBST(missingkernel)
2024-02-08 16:58:16 +03:00
AC_SUBST(modulesdir)
2012-02-13 17:02:47 +04:00
AC_SUBST(systemdsystemunitdir)
2012-07-31 18:46:24 +04:00
AC_SUBST(systemdutildir)
2023-02-22 16:11:50 +03:00
AC_SUBST(tmpdir)
2012-02-22 21:55:10 +04:00
AC_SUBST(tmpfilesdir)
2023-02-22 16:11:50 +03:00
AC_SUBST(udevdir)
AC_SUBST(udev_prefix)
2008-10-07 23:11:59 +04:00
AC_SUBST(usrlibdir)
AC_SUBST(usrsbindir)
2004-03-26 17:17:14 +03:00
2004-06-28 18:01:24 +04:00
################################################################################
2007-09-18 22:26:32 +04:00
dnl -- First and last lines should not contain files to generate in order to
2004-06-29 17:29:25 +04:00
dnl -- keep utility scripts running properly
2007-09-18 22:26:32 +04:00
AC_CONFIG_FILES([
Makefile
make.tmpl
2018-05-14 14:16:43 +03:00
libdm/make.tmpl
2007-09-18 22:26:32 +04:00
daemons/Makefile
2009-09-02 23:32:37 +04:00
daemons/cmirrord/Makefile
2008-11-01 01:06:09 +03:00
daemons/dmeventd/Makefile
daemons/dmeventd/libdevmapper-event.pc
2008-11-01 01:29:44 +03:00
daemons/dmeventd/plugins/Makefile
2010-01-22 01:15:45 +03:00
daemons/dmeventd/plugins/lvm2/Makefile
2011-08-11 09:00:20 +04:00
daemons/dmeventd/plugins/raid/Makefile
2008-11-01 01:06:09 +03:00
daemons/dmeventd/plugins/mirror/Makefile
daemons/dmeventd/plugins/snapshot/Makefile
2011-12-21 17:08:11 +04:00
daemons/dmeventd/plugins/thin/Makefile
2018-07-09 12:41:26 +03:00
daemons/dmeventd/plugins/vdo/Makefile
2016-02-18 02:53:35 +03:00
daemons/lvmdbusd/Makefile
2017-12-11 14:36:54 +03:00
daemons/lvmdbusd/lvmdbusd
2017-12-12 15:10:51 +03:00
daemons/lvmdbusd/lvmdb.py
daemons/lvmdbusd/lvm_shell_proxy.py
2016-02-18 02:53:35 +03:00
daemons/lvmdbusd/path.py
2015-05-09 02:59:18 +03:00
daemons/lvmpolld/Makefile
2015-03-05 23:00:44 +03:00
daemons/lvmlockd/Makefile
2013-06-28 12:46:00 +04:00
conf/Makefile
conf/example.conf
2015-02-24 01:19:08 +03:00
conf/lvmlocal.conf
2014-05-21 14:32:12 +04:00
conf/command_profile_template.profile
conf/metadata_profile_template.profile
2008-11-01 01:06:09 +03:00
include/Makefile
lib/Makefile
2015-09-11 22:30:05 +03:00
include/lvm-version.h
2012-02-28 22:18:48 +04:00
libdaemon/Makefile
libdaemon/client/Makefile
libdaemon/server/Makefile
2008-11-01 01:06:09 +03:00
libdm/Makefile
2018-06-14 15:08:33 +03:00
libdm/dm-tools/Makefile
2008-11-01 01:06:09 +03:00
libdm/libdevmapper.pc
man/Makefile
po/Makefile
2018-11-26 21:49:39 +03:00
scripts/lvm2-pvscan.service
2012-10-12 16:37:57 +04:00
scripts/blkdeactivate.sh
scripts/blk_availability_init_red_hat
scripts/blk_availability_systemd_red_hat.service
2014-04-29 14:44:32 +04:00
scripts/cmirrord_init_red_hat
2016-02-18 02:53:35 +03:00
scripts/com.redhat.lvmdbus1.service
2014-04-29 14:44:32 +04:00
scripts/dm_event_systemd_red_hat.service
scripts/dm_event_systemd_red_hat.socket
2014-02-11 12:55:57 +04:00
scripts/lvm2_cmirrord_systemd_red_hat.service
2016-02-18 02:53:35 +03:00
scripts/lvm2_lvmdbusd_systemd_red_hat.service
2015-05-09 02:59:18 +03:00
scripts/lvm2_lvmpolld_init_red_hat
scripts/lvm2_lvmpolld_systemd_red_hat.service
scripts/lvm2_lvmpolld_systemd_red_hat.socket
2018-09-13 19:02:53 +03:00
scripts/lvmlockd.service
scripts/lvmlocks.service
2009-09-17 03:22:40 +04:00
scripts/lvm2_monitoring_init_red_hat
2011-07-28 16:57:26 +04:00
scripts/lvm2_monitoring_systemd_red_hat.service
2012-02-22 21:55:10 +04:00
scripts/lvm2_tmpfiles_red_hat.conf
2016-09-15 15:59:52 +03:00
scripts/lvmdump.sh
2007-09-18 22:26:32 +04:00
scripts/Makefile
2008-11-01 01:06:09 +03:00
test/Makefile
2007-09-18 22:26:32 +04:00
tools/Makefile
2009-07-31 15:49:53 +04:00
udev/Makefile
2007-08-14 23:11:31 +04:00
])
AC_OUTPUT
2003-11-06 20:14:06 +03:00
2015-05-12 15:46:36 +03:00
AS_IF([test -n "$THIN_CONFIGURE_WARN"],
[AC_MSG_WARN([Support for thin provisioning is limited since some thin provisioning tools are missing!])])
2013-12-12 16:07:59 +04:00
2015-05-12 15:46:36 +03:00
AS_IF([test -n "$THIN_CHECK_VERSION_WARN"],
2017-06-09 23:30:23 +03:00
[AC_MSG_WARN([You should also install latest thin_check vsn 0.7.0 (or later) for lvm2 thin provisioning])])
2014-04-07 19:44:29 +04:00
2015-05-12 15:46:36 +03:00
AS_IF([test -n "$CACHE_CONFIGURE_WARN"],
[AC_MSG_WARN([Support for cache is limited since some cache tools are missing!])])
2014-07-04 18:31:29 +04:00
2017-06-09 23:30:23 +03:00
AS_IF([test -n "$CACHE_CHECK_VERSION_WARN"],
[AC_MSG_WARN([You should install latest cache_check vsn 0.7.0 to use lvm2 cache metadata format 2])])
2018-06-29 14:38:18 +03:00
AS_IF([test -n "$VDO_CONFIGURE_WARN"],
2020-09-12 20:04:22 +03:00
[AC_MSG_WARN([Unrecognized 'vdoformat' tool is REQUIRED for VDO logical volume creation!])])
2018-06-29 14:38:18 +03:00
2021-04-10 23:09:32 +03:00
AS_IF([test -n "$LVM_NEEDS_LIBAIO_WARN"],
[AC_MSG_WARN([Only libdm part can be build without libaio: make [[install_]]device-mapper])])
2017-06-09 23:30:23 +03:00
2023-02-09 19:37:17 +03:00
AS_IF([test "$ODIRECT" != "yes"],
2015-05-12 15:46:36 +03:00
[AC_MSG_WARN([O_DIRECT disabled: low-memory pvmove may lock up])])
2023-10-13 22:28:56 +03:00
AS_IF([test "$BUILD_LVMDBUSD" = "yes" && test "$NOTIFYDBUS_SUPPORT" = "no"],
[AC_MSG_WARN([Building D-Bus support without D-Bus notifications!])])