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.
2014-06-05 19:26:53 +04:00
## Copyright (C) 2004-2014 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,
## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2001-09-21 16:37:43 +04:00
################################################################################
2010-03-04 12:46:38 +03:00
AC_PREREQ(2.61)
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
AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
2008-06-13 18:37:18 +04:00
AC_CONFIG_HEADERS([lib/misc/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
case "$host_os" in
linux*)
2009-04-25 01:44:15 +04:00
CFLAGS="$CFLAGS"
2004-06-29 17:29:25 +04:00
COPTIMISE_FLAG="-O2"
2004-06-28 18:01:24 +04:00
CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
2011-11-15 01:30:35 +04:00
ELDFLAGS="-Wl,--export-dynamic"
# 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"
2004-06-28 18:01:24 +04:00
LDDEPS="$LDDEPS .export.sym"
2008-06-13 18:37:18 +04:00
LIB_SUFFIX=so
2004-03-26 17:17:14 +03:00
DEVMAPPER=yes
2011-08-31 15:31:57 +04:00
LVMETAD=no
2004-06-15 21:23:49 +04:00
ODIRECT=yes
2008-06-13 18:37:18 +04:00
DM_IOCTLS=yes
2004-06-28 18:01:24 +04:00
SELINUX=yes
2004-06-24 12:02:38 +04:00
CLUSTER=internal
2008-11-01 01:06:09 +03:00
FSADM=yes
2012-10-12 16:37:57 +04:00
BLKDEACTIVATE=yes
2008-06-13 18:37:18 +04:00
;;
2004-03-26 17:17:14 +03:00
darwin*)
2004-06-28 18:01:24 +04:00
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
2004-06-29 17:29:25 +04:00
COPTIMISE_FLAG="-O2"
2004-06-28 18:01:24 +04:00
CLDFLAGS="$CLDFLAGS"
2011-11-15 01:30:35 +04:00
ELDFLAGS=
2004-03-26 17:17:14 +03:00
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
2008-06-13 18:37:18 +04:00
LIB_SUFFIX=dylib
2005-10-17 21:56:27 +04:00
DEVMAPPER=yes
2004-06-15 21:23:49 +04:00
ODIRECT=no
2008-06-13 18:37:18 +04:00
DM_IOCTLS=no
2004-06-28 18:01:24 +04:00
SELINUX=no
2004-06-24 12:02:38 +04:00
CLUSTER=none
2008-06-13 18:37:18 +04:00
FSADM=no
2012-10-12 16:37:57 +04:00
BLKDEACTIVATE=no
2008-06-13 18:37:18 +04:00
;;
2003-04-15 17:24:42 +04:00
esac
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
AC_PROG_CC
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
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
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(CFLOW_CMD, cflow)
AC_PATH_TOOL(CSCOPE_CMD, cscope)
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
2004-06-28 18:01:24 +04:00
AC_HEADER_STDC
2004-07-03 22:21:13 +04:00
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
2008-06-13 18:37:18 +04:00
AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
2010-07-06 02:23:15 +04:00
langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
sys/wait.h time.h], ,
2008-06-13 18:37:18 +04:00
[AC_MSG_ERROR(bailing out)])
2004-07-03 22:21:13 +04:00
case "$host_os" in
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)) ;;
esac
2004-06-28 18:01:24 +04:00
2008-06-13 18:37:18 +04:00
AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
AC_CHECK_HEADERS(termios.h sys/statvfs.h)
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])
2004-06-28 18:01:24 +04:00
AC_TYPE_OFF_T
AC_TYPE_PID_T
2008-06-13 18:37:18 +04:00
AC_TYPE_SIGNAL
2004-06-28 18:01:24 +04:00
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
2007-08-14 23:11:31 +04:00
AC_CHECK_MEMBERS([struct stat.st_rdev])
2004-07-03 22:21:13 +04:00
AC_STRUCT_TM
################################################################################
dnl -- Check for functions
2010-10-13 16:18:53 +04:00
AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
2010-07-06 02:23:15 +04:00
gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
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
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
2009-01-20 20:07:53 +03:00
################################################################################
dnl -- Enables statically-linked tools
AC_MSG_CHECKING(whether to use static linking)
AC_ARG_ENABLE(static_link,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--enable-static_link],
[use this to link the tools to their libraries
statically (default is dynamic linking]),
STATIC_LINK=$enableval, STATIC_LINK=no)
2009-01-20 20:07:53 +03:00
AC_MSG_RESULT($STATIC_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)
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Setup the ownership of the files
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(file owner)
2001-09-21 16:37:43 +04:00
AC_ARG_WITH(user,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-user=USER],
[set the owner of installed files [[USER=]]]),
OWNER=$withval)
2004-07-03 22:21:13 +04: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
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(group owner)
2001-09-21 16:37:43 +04:00
AC_ARG_WITH(group,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-group=GROUP],
[set the group owner of installed files [[GROUP=]]]),
GROUP=$withval)
2004-07-03 22:21:13 +04: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
AC_MSG_CHECKING(device node uid)
AC_ARG_WITH(device-uid,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-device-uid=UID],
[set the owner used for new device nodes [[UID=0]]]),
DM_DEVICE_UID=$withval, DM_DEVICE_UID=0)
2008-11-01 05:19:19 +03:00
AC_MSG_RESULT($DM_DEVICE_UID)
################################################################################
dnl -- Setup device group ownership
AC_MSG_CHECKING(device node gid)
AC_ARG_WITH(device-gid,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-device-gid=GID],
[set the group used for new device nodes [[GID=0]]]),
DM_DEVICE_GID=$withval, DM_DEVICE_GID=0)
2008-11-01 05:19:19 +03:00
AC_MSG_RESULT($DM_DEVICE_GID)
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Setup device mode
AC_MSG_CHECKING(device node mode)
AC_ARG_WITH(device-mode,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-device-mode=MODE],
[set the mode used for new device nodes [[MODE=0600]]]),
DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
2008-11-01 01:06:09 +03:00
AC_MSG_RESULT($DM_DEVICE_MODE)
2011-02-05 01:17:54 +03:00
AC_MSG_CHECKING(when to create device nodes)
AC_ARG_WITH(device-nodes-on,
AC_HELP_STRING([--with-device-nodes-on=ON],
[create nodes on resume or create [[ON=resume]]]),
ADD_NODE=$withval, ADD_NODE=resume)
case "$ADD_NODE" in
resume) add_on=DM_ADD_NODE_ON_RESUME;;
create) add_on=DM_ADD_NODE_ON_CREATE;;
*) AC_MSG_ERROR([--with-device-nodes-on parameter invalid]);;
esac
AC_MSG_RESULT(on $ADD_NODE)
AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
2012-02-15 15:17:57 +04:00
AC_MSG_CHECKING(default name mangling)
AC_ARG_WITH(default-name-mangling,
AC_HELP_STRING([--with-default-name-mangling=MANGLING],
[default name mangling: auto/none/hex [[MANGLING=auto]]]),
MANGLING=$withval, MANGLING=auto)
case "$MANGLING" in
auto) mangling=DM_STRING_MANGLING_AUTO;;
2014-06-05 16:38:10 +04:00
none|disabled) mangling=DM_STRING_MANGLING_NONE;;
2012-02-15 15:17:57 +04:00
hex) mangling=DM_STRING_MANGLING_HEX;;
*) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
esac
AC_MSG_RESULT($MANGLING)
AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
2004-06-28 18:01:24 +04:00
################################################################################
2004-04-08 19:23:23 +04:00
dnl -- LVM1 tool fallback option
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to enable lvm1 fallback)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(lvm1_fallback,
AC_HELP_STRING([--enable-lvm1_fallback],
[use this to fall back and use LVM1 binaries if
device-mapper is missing from the kernel]),
LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($LVM1_FALLBACK)
2004-04-08 19:23:23 +04:00
2014-06-05 19:28:03 +04:00
if test "$LVM1_FALLBACK" = yes; then
2006-05-10 01:23:51 +04:00
AC_DEFINE([LVM1_FALLBACK], 1, [Define to 1 if 'lvm' should fall back to using LVM1 binaries if device-mapper is missing from the kernel])
2004-04-08 19:23:23 +04:00
fi
2004-06-28 18:01:24 +04:00
################################################################################
2002-11-18 17:04:08 +03:00
dnl -- format1 inclusion type
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to include support for lvm1 metadata)
2002-11-18 17:04:08 +03:00
AC_ARG_WITH(lvm1,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-lvm1=TYPE],
[LVM1 metadata support: internal/shared/none
[[TYPE=internal]]]),
LVM1=$withval, LVM1=internal)
2002-11-18 17:04:08 +03:00
2014-06-05 19:28:03 +04:00
AC_MSG_RESULT($LVM1)
2002-11-18 17:04:08 +03:00
2014-06-05 19:28:03 +04:00
case "$LVM1" in
2014-08-23 02:42:55 +04:00
none|shared) ;;
2014-06-05 19:28:03 +04:00
internal) AC_DEFINE([LVM1_INTERNAL], 1,
[Define to 1 to include built-in support for LVM1 metadata.]) ;;
*) AC_MSG_ERROR([--with-lvm1 parameter invalid]) ;;
esac
2003-04-15 17:24:42 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-07 23:10:21 +04:00
dnl -- format_pool inclusion type
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to include support for GFS pool metadata)
2004-06-07 23:10:21 +04:00
AC_ARG_WITH(pool,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-pool=TYPE],
[GFS pool read-only support: internal/shared/none
[[TYPE=internal]]]),
POOL=$withval, POOL=internal)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($POOL)
2004-06-07 23:10:21 +04:00
2014-06-05 19:28:03 +04:00
case "$POOL" in
none|shared) ;;
internal) AC_DEFINE([POOL_INTERNAL], 1,
[Define to 1 to include built-in support for GFS pool metadata.]) ;;
*) AC_MSG_ERROR([--with-pool parameter invalid])
esac
2004-06-07 23:10:21 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-24 12:02:38 +04:00
dnl -- cluster_locking inclusion type
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to include support for cluster locking)
2004-06-24 12:02:38 +04:00
AC_ARG_WITH(cluster,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-cluster=TYPE],
[cluster LVM locking support: internal/shared/none
[[TYPE=internal]]]),
CLUSTER=$withval)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($CLUSTER)
2004-06-24 12:02:38 +04:00
2014-06-05 19:28:03 +04:00
case "$CLUSTER" in
none|shared) ;;
internal) AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1,
[Define to 1 to include built-in support for clustered LVM locking.]) ;;
*) AC_MSG_ERROR([--with-cluster parameter invalid]) ;;
esac
2004-06-07 23:10:21 +04:00
2004-06-28 18:01:24 +04:00
################################################################################
2004-05-05 01:25:57 +04:00
dnl -- snapshots inclusion type
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to include snapshots)
2004-05-05 01:25:57 +04:00
AC_ARG_WITH(snapshots,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-snapshots=TYPE],
[snapshot support: internal/shared/none
[[TYPE=internal]]]),
SNAPSHOTS=$withval, SNAPSHOTS=internal)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($SNAPSHOTS)
2004-05-05 01:25:57 +04:00
2014-06-05 19:28:03 +04:00
case "$SNAPSHOTS" in
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]) ;;
esac
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
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to include mirrors)
2004-05-05 01:25:57 +04:00
AC_ARG_WITH(mirrors,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-mirrors=TYPE],
[mirror support: internal/shared/none
[[TYPE=internal]]]),
MIRRORS=$withval, MIRRORS=internal)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($MIRRORS)
2004-05-05 01:25:57 +04:00
2014-06-05 19:28:03 +04:00
case "$MIRRORS" in
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]) ;;
esac
2004-05-05 01:25:57 +04:00
2011-08-03 02:07:20 +04:00
################################################################################
dnl -- raid inclusion type
AC_MSG_CHECKING(whether to include raid)
AC_ARG_WITH(raid,
AC_HELP_STRING([--with-raid=TYPE],
2013-05-17 23:30:29 +04:00
[raid support: internal/shared/none
2011-08-03 02:07:20 +04:00
[[TYPE=internal]]]),
RAID=$withval, RAID=internal)
AC_MSG_RESULT($RAID)
2014-06-05 19:28:03 +04:00
case "$RAID" in
none|shared) ;;
internal) AC_DEFINE([RAID_INTERNAL], 1,
[Define to 1 to include built-in support for raid.]) ;;
*) AC_MSG_ERROR([--with-raid parameter invalid]) ;;
esac
2011-08-03 02:07:20 +04:00
2010-05-21 16:36:30 +04:00
################################################################################
dnl -- asynchronous volume replicator inclusion type
AC_MSG_CHECKING(whether to include replicators)
2010-07-08 16:02:48 +04:00
AC_ARG_WITH(replicators,
AC_HELP_STRING([--with-replicators=TYPE],
[replicator support: internal/shared/none
[[TYPE=none]]]),
REPLICATORS=$withval, REPLICATORS=none)
2010-05-21 16:36:30 +04:00
AC_MSG_RESULT($REPLICATORS)
case "$REPLICATORS" in
none|shared) ;;
internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
[Define to 1 to include built-in support for replicators.]) ;;
*) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
esac
2011-08-24 12:27:49 +04:00
################################################################################
dnl -- thin provisioning
AC_MSG_CHECKING(whether to include thin provisioning)
AC_ARG_WITH(thin,
AC_HELP_STRING([--with-thin=TYPE],
[thin provisioning support: internal/shared/none
2013-12-12 16:07:59 +04:00
[[TYPE=internal]]]),
THIN=$withval, THIN=internal)
AC_ARG_WITH(thin-check,
AC_HELP_STRING([--with-thin-check=PATH],
2013-12-12 17:29:15 +04:00
[thin_check tool: [[autodetect]]]),
THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
2013-12-12 16:07:59 +04:00
AC_ARG_WITH(thin-dump,
AC_HELP_STRING([--with-thin-dump=PATH],
2013-12-12 17:29:15 +04:00
[thin_dump tool: [[autodetect]]]),
THIN_DUMP_CMD=$withval, THIN_DUMP_CMD="autodetect")
2013-12-12 16:07:59 +04:00
AC_ARG_WITH(thin-repair,
AC_HELP_STRING([--with-thin-repair=PATH],
2013-12-12 17:29:15 +04:00
[thin_repair tool: [[autodetect]]]),
THIN_REPAIR_CMD=$withval, THIN_REPAIR_CMD="autodetect")
2014-05-27 01:28:03 +04:00
AC_ARG_WITH(thin-restore,
AC_HELP_STRING([--with-thin-restore=PATH],
[thin_restore tool: [[autodetect]]]),
THIN_RESTORE_CMD=$withval, THIN_RESTORE_CMD="autodetect")
2013-12-12 16:07:59 +04:00
2011-08-24 12:27:49 +04:00
AC_MSG_RESULT($THIN)
case "$THIN" in
none|shared) ;;
internal) AC_DEFINE([THIN_INTERNAL], 1,
2014-06-05 19:28:03 +04:00
[Define to 1 to include built-in support for thin provisioning.]) ;;
2011-08-24 12:27:49 +04:00
*) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
esac
2014-04-07 19:44:29 +04:00
dnl -- thin_check needs-check flag
AC_ARG_ENABLE(thin_check_needs_check,
AC_HELP_STRING([--disable-thin_check_needs_check],
[required if thin_check version is < 0.3.0]),
THIN_CHECK_NEEDS_CHECK=$enableval, THIN_CHECK_NEEDS_CHECK=yes)
2013-12-12 16:07:59 +04:00
# Test if necessary thin tools are available
# if not - use plain defaults and warn user
2012-03-14 21:09:00 +04:00
case "$THIN" in
internal|shared)
# Empty means a config way to ignore thin checking
2013-12-12 17:29:15 +04:00
if test "$THIN_CHECK_CMD" = "autodetect"; then
AC_PATH_TOOL(THIN_CHECK_CMD, thin_check)
2014-04-07 19:44:29 +04:00
if test -z "$THIN_CHECK_CMD"; then
2013-12-12 16:07:59 +04:00
AC_MSG_WARN([thin_check not found in path $PATH])
2013-12-12 17:29:15 +04:00
THIN_CHECK_CMD=/usr/sbin/thin_check
2013-12-12 16:07:59 +04:00
THIN_CONFIGURE_WARN=y
2014-05-12 16:51:23 +04:00
fi
fi
if test "$THIN_CHECK_NEEDS_CHECK" = yes; then
THIN_CHECK_VSN=`"$THIN_CHECK_CMD" -V 2>/dev/null`
THIN_CHECK_VSN_MAJOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}'`
THIN_CHECK_VSN_MINOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}'`
if test -z "$THIN_CHECK_VSN_MAJOR" -o -z "$THIN_CHECK_VSN_MINOR"; then
AC_MSG_WARN([$THIN_CHECK_CMD: Bad version "$THIN_CHECK_VSN" found])
THIN_CHECK_VERSION_WARN=y
THIN_CHECK_NEEDS_CHECK=no
elif test "$THIN_CHECK_VSN_MAJOR" -eq 0 -a "$THIN_CHECK_VSN_MINOR" -lt 3; then
AC_MSG_WARN([$THIN_CHECK_CMD: Old version "$THIN_CHECK_VSN" found])
THIN_CHECK_VERSION_WARN=y
THIN_CHECK_NEEDS_CHECK=no
2014-04-07 19:44:29 +04:00
fi
2012-03-14 21:09:00 +04:00
fi
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore thin dumping
2013-12-12 17:29:15 +04:00
if test "$THIN_DUMP_CMD" = "autodetect"; then
AC_PATH_TOOL(THIN_DUMP_CMD, thin_dump)
test -z "$THIN_DUMP_CMD" && {
2013-12-12 16:07:59 +04:00
AC_MSG_WARN(thin_dump not found in path $PATH)
2013-12-12 17:29:15 +04:00
THIN_DUMP_CMD=/usr/sbin/thin_dump
2013-12-12 16:07:59 +04:00
THIN_CONFIGURE_WARN=y
}
2013-07-31 16:38:10 +04:00
fi
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore thin repairing
2013-12-12 17:29:15 +04:00
if test "$THIN_REPAIR_CMD" = "autodetect"; then
2013-12-12 16:07:59 +04:00
AC_PATH_TOOL(THIN_REPAIR_CMD, thin_repair)
test -z "$THIN_REPAIR_CMD" && {
AC_MSG_WARN(thin_repair not found in path $PATH)
2013-12-12 17:29:15 +04:00
THIN_REPAIR_CMD=/usr/sbin/thin_repair
2013-12-12 16:07:59 +04:00
THIN_CONFIGURE_WARN=y
}
2013-07-31 16:38:10 +04:00
fi
2014-07-04 18:31:29 +04:00
# Empty means a config way to ignore thin restoring
2014-05-27 01:28:03 +04:00
if test "$THIN_RESTORE_CMD" = "autodetect"; then
AC_PATH_TOOL(THIN_RESTORE_CMD, thin_restore)
test -z "$THIN_RESTORE_CMD" && {
AC_MSG_WARN(thin_restore not found in path $PATH)
THIN_RESTORE_CMD=/usr/sbin/thin_restore
THIN_CONFIGURE_WARN=y
}
fi
2012-03-14 21:09:00 +04:00
;;
esac
2014-05-12 16:51:23 +04:00
AC_MSG_CHECKING([whether thin_check supports the needs-check flag])
AC_MSG_RESULT([$THIN_CHECK_NEEDS_CHECK])
if test "$THIN_CHECK_NEEDS_CHECK" = yes; then
AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
fi
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
AC_MSG_CHECKING(whether to include cache)
AC_ARG_WITH(cache,
AC_HELP_STRING([--with-cache=TYPE],
2014-07-04 18:31:29 +04:00
[cache support: internal/shared/none [[TYPE=none]]]),
CACHE=$withval, CACHE="none")
AC_ARG_WITH(cache-check,
AC_HELP_STRING([--with-cache-check=PATH],
[cache_check tool: [[autodetect]]]),
CACHE_CHECK_CMD=$withval, CACHE_CHECK_CMD="autodetect")
AC_ARG_WITH(cache-dump,
AC_HELP_STRING([--with-cache-dump=PATH],
[cache_dump tool: [[autodetect]]]),
CACHE_DUMP_CMD=$withval, CACHE_DUMP_CMD="autodetect")
AC_ARG_WITH(cache-repair,
AC_HELP_STRING([--with-cache-repair=PATH],
[cache_repair tool: [[autodetect]]]),
CACHE_REPAIR_CMD=$withval, CACHE_REPAIR_CMD="autodetect")
AC_ARG_WITH(cache-restore,
AC_HELP_STRING([--with-cache-restore=PATH],
[cache_restore tool: [[autodetect]]]),
CACHE_RESTORE_CMD=$withval, CACHE_RESTORE_CMD="autodetect")
2014-01-27 15:27:16 +04:00
AC_MSG_RESULT($CACHE)
2014-06-05 19:28:03 +04:00
case "$CACHE" in
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]) ;;
esac
2012-03-14 21:09:00 +04:00
2014-07-04 18:31:29 +04:00
# Test if necessary cache tools are available
# if not - use plain defaults and warn user
case "$CACHE" in
internal|shared)
# Empty means a config way to ignore cache checking
if test "$CACHE_CHECK_CMD" = "autodetect"; then
AC_PATH_TOOL(CACHE_CHECK_CMD, cache_check)
if test -z "$CACHE_CHECK_CMD"; then
AC_MSG_WARN([cache_check not found in path $PATH])
CACHE_CHECK_CMD=/usr/sbin/cache_check
CACHE_CONFIGURE_WARN=y
fi
fi
# Empty means a config way to ignore cache dumping
if test "$CACHE_DUMP_CMD" = "autodetect"; then
AC_PATH_TOOL(CACHE_DUMP_CMD, cache_dump)
test -z "$CACHE_DUMP_CMD" && {
AC_MSG_WARN(cache_dump not found in path $PATH)
CACHE_DUMP_CMD=/usr/sbin/cache_dump
CACHE_CONFIGURE_WARN=y
}
fi
# Empty means a config way to ignore cache repairing
if test "$CACHE_REPAIR_CMD" = "autodetect"; then
AC_PATH_TOOL(CACHE_REPAIR_CMD, cache_repair)
test -z "$CACHE_REPAIR_CMD" && {
AC_MSG_WARN(cache_repair not found in path $PATH)
CACHE_REPAIR_CMD=/usr/sbin/cache_repair
CACHE_CONFIGURE_WARN=y
}
fi
# Empty means a config way to ignore cache restoring
if test "$CACHE_RESTORE_CMD" = "autodetect"; then
AC_PATH_TOOL(CACHE_RESTORE_CMD, cache_restore)
test -z "$CACHE_RESTORE_CMD" && {
AC_MSG_WARN(cache_restore not found in path $PATH)
CACHE_RESTORE_CMD=/usr/sbin/cache_restore
CACHE_CONFIGURE_WARN=y
}
fi
;;
esac
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.])
2004-06-28 18:01:24 +04:00
################################################################################
2008-06-27 23:57:27 +04:00
dnl -- Disable readline
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to enable readline)
2008-06-23 13:23:48 +04:00
AC_ARG_ENABLE([readline],
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--disable-readline], [disable readline support]),
READLINE=$enableval, READLINE=maybe)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($READLINE)
2001-09-21 16:37:43 +04:00
2006-10-01 00:02:02 +04:00
################################################################################
dnl -- Disable realtime clock support
AC_MSG_CHECKING(whether to enable realtime support)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(realtime,
AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
REALTIME=$enableval)
2006-10-01 00:02:02 +04:00
AC_MSG_RESULT($REALTIME)
2010-11-05 19:18:38 +03:00
################################################################################
dnl -- disable OCF resource agents
AC_MSG_CHECKING(whether to enable OCF resource agents)
AC_ARG_ENABLE(ocf,
AC_HELP_STRING([--enable-ocf],
[enable Open Cluster Framework (OCF) compliant resource agents]),
OCF=$enableval, OCF=no)
AC_MSG_RESULT($OCF)
2011-01-10 16:00:53 +03:00
AC_ARG_WITH(ocfdir,
AC_HELP_STRING([--with-ocfdir=DIR],
[install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
2010-11-05 19:18:38 +03:00
2009-09-15 02:57:46 +04:00
################################################################################
dnl -- Init pkg-config with dummy invokation:
dnl -- this is required because PKG_CHECK_MODULES macro is expanded
dnl -- to initialize the pkg-config environment only at the first invokation,
dnl -- that would be conditional in this configure.in.
pkg_config_init() {
2014-06-05 19:28:03 +04:00
if test "$PKGCONFIG_INIT" != 1; then
PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
[AC_MSG_RESULT([pkg-config initialized])])
PKGCONFIG_INIT=1
fi
2009-09-15 02:57:46 +04:00
}
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,
AC_HELP_STRING([--with-default-pid-dir=PID_DIR],
[Default directory to keep PID files in. [[/var/run]]]),
DEFAULT_PID_DIR="$withval", DEFAULT_PID_DIR="/var/run")
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,
AC_HELP_STRING([--with-default-dm-run-dir=DM_RUN_DIR],
[ Default DM run directory. [[/var/run]]]),
DEFAULT_DM_RUN_DIR="$withval", DEFAULT_DM_RUN_DIR="/var/run")
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,
AC_HELP_STRING([--with-default-run-dir=RUN_DIR],
[Default LVM run directory. [[/var/run/lvm]]]),
DEFAULT_RUN_DIR="$withval", DEFAULT_RUN_DIR="/var/run/lvm")
AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR, ["$DEFAULT_RUN_DIR"],
[Default LVM run directory.])
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Build cluster LVM daemon
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to build cluster LVM daemon)
2004-11-26 21:07:17 +03:00
AC_ARG_WITH(clvmd,
2010-07-08 16:02:48 +04:00
[ --with-clvmd=TYPE build cluster LVM Daemon
2009-09-01 23:11:45 +04:00
The following cluster manager combinations are valid:
2009-08-28 23:22:05 +04:00
* cman (RHEL5 or equivalent)
* cman,corosync,openais (or selection of them)
2010-03-18 12:19:30 +03:00
* singlenode (localhost only)
2009-08-28 23:22:05 +04:00
* all (autodetect)
* none (disable build)
2010-07-08 16:02:48 +04:00
[[TYPE=none]]],
CLVMD=$withval, CLVMD=none)
2014-06-05 19:28:03 +04:00
test "$CLVMD" = yes && CLVMD=all
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($CLVMD)
2004-06-28 18:01:24 +04:00
2004-06-29 17:29:25 +04:00
dnl -- If clvmd enabled without cluster locking, automagically include it
2014-06-05 19:28:03 +04:00
test "$CLVMD" != none -a "$CLUSTER" = none && CLUSTER=internal
2004-06-24 12:02:38 +04:00
2009-09-15 02:57:46 +04:00
dnl -- init pkgconfig if required
2014-06-05 19:28:03 +04:00
test "$CLVMD" != none && pkg_config_init
2009-09-15 02:57:46 +04:00
2010-08-23 15:37:02 +04:00
dnl -- Express clvmd init script Required-Start / Required-Stop
CLVMD_CMANAGERS=""
dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
2011-08-09 22:11:00 +04:00
dnl -- Enable if we are build for cman.
2010-08-23 15:37:02 +04:00
CLVMD_NEEDS_QDISKD=no
2009-09-15 02:57:46 +04:00
2009-08-28 23:22:05 +04:00
dnl -- define build types
if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
2011-08-09 22:11:00 +04:00
AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]);
2010-08-23 15:37:02 +04:00
fi
if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
BUILDCMAN=yes
CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
CLVMD_NEEDS_QDISKD=yes
2009-08-28 23:22:05 +04:00
fi
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
BUILDCOROSYNC=yes
2010-08-23 15:37:02 +04:00
CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
2009-08-28 23:22:05 +04:00
fi
if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
BUILDOPENAIS=yes
2010-08-23 15:37:02 +04:00
CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
2009-08-28 23:22:05 +04:00
fi
2014-06-05 19:28:03 +04:00
test "$CLVMD_NEEDS_QDISKD" != no && CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
2009-08-28 23:22:05 +04:00
dnl -- define a soft bailout if we are autodetecting
soft_bailout() {
NOTFOUND=1
}
hard_bailout() {
AC_MSG_ERROR([bailing out])
}
2014-06-05 19:28:03 +04:00
dnl -- if clvmd=all then set soft_bailout (we do not want to error)
2009-08-28 23:22:05 +04:00
dnl -- and set all builds to yes. We need to do this here
2011-08-09 22:11:00 +04:00
dnl -- to skip the openais|corosync sanity check above.
2014-06-05 19:28:03 +04:00
if test "$CLVMD" = all; then
2009-08-28 23:22:05 +04:00
bailout=soft_bailout
BUILDCMAN=yes
BUILDCOROSYNC=yes
BUILDOPENAIS=yes
else
bailout=hard_bailout
fi
dnl -- helper macro to check libs without adding them to LIBS
check_lib_no_libs() {
lib_no_libs_arg1=$1
shift
lib_no_libs_arg2=$1
shift
lib_no_libs_args=$@
AC_CHECK_LIB([$lib_no_libs_arg1],
[$lib_no_libs_arg2],,
[$bailout],
[$lib_no_libs_args])
LIBS=$ac_check_lib_save_LIBS
}
dnl -- Look for cman libraries if required.
2014-06-05 19:28:03 +04:00
if test "$BUILDCMAN" = yes; then
2009-08-28 23:22:05 +04:00
PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
[NOTFOUND=0
AC_CHECK_HEADERS(libcman.h,,$bailout)
check_lib_no_libs cman cman_init
if test $NOTFOUND = 0; then
AC_MSG_RESULT([no pkg for libcman, using -lcman])
CMAN_LIBS="-lcman"
HAVE_CMAN=yes
fi])
CHECKCONFDB=yes
CHECKDLM=yes
fi
2014-06-05 19:28:03 +04:00
dnl -- Look for corosync that is required also for openais build
2009-08-28 23:22:05 +04:00
dnl -- only enough recent version of corosync ship pkg-config files.
dnl -- We can safely rely on that to detect the correct bits.
2014-06-05 19:28:03 +04:00
if test "$BUILDCOROSYNC" = yes -o "$BUILDOPENAIS" = yes; then
2009-08-28 23:22:05 +04:00
PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
CHECKCONFDB=yes
2012-02-01 01:21:53 +04:00
CHECKCMAP=yes
2009-08-28 23:22:05 +04:00
fi
2009-02-26 01:41:12 +03:00
dnl -- Look for corosync libraries if required.
2014-06-05 19:28:03 +04:00
if test "$BUILDCOROSYNC" = yes; then
2009-08-28 23:22:05 +04:00
PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
CHECKCPG=yes
CHECKDLM=yes
fi
dnl -- Look for openais libraries if required.
2014-06-05 19:28:03 +04:00
if test "$BUILDOPENAIS" = yes; then
2009-08-28 23:22:05 +04:00
PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
CHECKCPG=yes
fi
dnl -- Below are checks for libraries common to more than one build.
dnl -- Check confdb library.
2012-02-01 01:21:53 +04:00
dnl -- mandatory for corosync < 2.0 build.
2009-08-28 23:22:05 +04:00
dnl -- optional for openais/cman build.
2014-06-05 19:28:03 +04:00
if test "$CHECKCONFDB" = yes; then
2009-08-28 23:22:05 +04:00
PKG_CHECK_MODULES(CONFDB, libconfdb,
2014-06-05 19:28:03 +04:00
[HAVE_CONFDB=yes], [HAVE_CONFDB=no])
2009-08-28 23:22:05 +04:00
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS([corosync/confdb.h],
[HAVE_CONFDB_H=yes], [HAVE_CONFDB_H=no])
2009-08-28 23:22:05 +04:00
2014-06-05 19:28:03 +04:00
if test "$HAVE_CONFDB" != yes -a "$HAVE_CONFDB_H" = yes; then
2009-08-28 23:22:05 +04:00
check_lib_no_libs confdb confdb_initialize
AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
CONFDB_LIBS="-lconfdb"
HAVE_CONFDB=yes
fi
2012-02-01 01:21:53 +04:00
fi
dnl -- Check cmap library
dnl -- mandatory for corosync >= 2.0 build.
2014-06-05 19:28:03 +04:00
if test "$CHECKCMAP" = yes; then
2012-02-01 01:21:53 +04:00
PKG_CHECK_MODULES(CMAP, libcmap,
2014-06-05 19:28:03 +04:00
[HAVE_CMAP=yes], [HAVE_CMAP=no])
2009-08-28 23:22:05 +04:00
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS([corosync/cmap.h],
[HAVE_CMAP_H=yes], [HAVE_CMAP_H=no])
2012-02-01 01:21:53 +04:00
2014-06-05 19:28:03 +04:00
if test "$HAVE_CMAP" != yes -a "$HAVE_CMAP_H" = yes; then
2012-02-01 01:21:53 +04:00
check_lib_no_libs cmap cmap_initialize
AC_MSG_RESULT([no pkg for cmap, using -lcmap])
CMAP_LIBS="-lcmap"
HAVE_CMAP=yes
fi
fi
2014-06-05 19:28:03 +04:00
if test "$BUILDCOROSYNC" = yes -a \
"$HAVE_CMAP" != yes -a "$HAVE_CONFDB" != yes -a "$CLVMD" != all; then
AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
2009-08-28 23:22:05 +04:00
fi
dnl -- Check cpg library.
2014-06-05 19:28:03 +04:00
if test "$CHECKCPG" = yes; then
PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], [$bailout])
2009-08-28 23:22:05 +04:00
fi
dnl -- Check dlm library.
2014-06-05 19:28:03 +04:00
if test "$CHECKDLM" = yes; then
2009-08-28 23:22:05 +04:00
PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
[NOTFOUND=0
2014-06-05 19:28:03 +04:00
AC_CHECK_HEADERS(libdlm.h,,[$bailout])
2009-08-28 23:22:05 +04:00
check_lib_no_libs dlm dlm_lock -lpthread
if test $NOTFOUND = 0; then
AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
DLM_LIBS="-ldlm -lpthread"
HAVE_DLM=yes
fi])
fi
dnl -- If we are autodetecting, we need to re-create
2010-08-23 15:37:02 +04:00
dnl -- the depedencies checks and set a proper CLVMD,
dnl -- together with init script Required-Start/Stop entries.
2014-06-05 19:28:03 +04:00
if test "$CLVMD" = all; then
2009-09-01 23:11:45 +04:00
CLVMD=none
2010-08-23 15:37:02 +04:00
CLVMD_CMANAGERS=""
CLVMD_NEEDS_QDISKD=no
2014-06-05 19:28:03 +04:00
if test "$HAVE_CMAN" = yes -a \
"$HAVE_DLM" = yes; then
2009-09-01 23:11:45 +04:00
AC_MSG_RESULT([Enabling clvmd cman cluster manager])
CLVMD="$CLVMD,cman"
2010-08-23 15:37:02 +04:00
CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
CLVMD_NEEDS_QDISKD=yes
2009-08-28 23:22:05 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$HAVE_COROSYNC" = yes -a \
"$HAVE_QUORUM" = yes -a \
"$HAVE_CPG" = yes -a \
"$HAVE_DLM" = yes; then
if test "$HAVE_CONFDB" = yes -o "$HAVE_CMAP" = yes; then
2009-09-01 23:11:45 +04:00
AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
CLVMD="$CLVMD,corosync"
2010-08-23 15:37:02 +04:00
CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
2012-02-01 01:21:53 +04:00
fi
2009-08-28 23:22:05 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$HAVE_COROSYNC" = yes -a \
"$HAVE_CPG" = yes -a \
"$HAVE_SALCK" = yes; then
2009-09-01 23:11:45 +04:00
AC_MSG_RESULT([Enabling clvmd openais cluster manager])
CLVMD="$CLVMD,openais"
2010-08-23 15:37:02 +04:00
CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
fi
2014-06-05 19:28:03 +04:00
test "$CLVMD_NEEDS_QDISKD" != no && CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
test "$CLVMD" = none && AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
2009-02-26 01:41:12 +03:00
fi
2012-02-13 09:24:57 +04:00
dnl -- Fixup CLVMD_CMANAGERS with new corosync
dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
dnl -- to be started.
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
2014-06-05 19:28:03 +04:00
test "$HAVE_CMAP" = yes && CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
2012-02-13 09:24:57 +04:00
fi
2010-07-13 17:51:01 +04:00
################################################################################
dnl -- clvmd pidfile
2014-06-05 19:28:03 +04:00
if test "$CLVMD" != none; then
2010-07-13 17:51:01 +04:00
AC_ARG_WITH(clvmd-pidfile,
AC_HELP_STRING([--with-clvmd-pidfile=PATH],
2012-06-21 16:41:52 +04:00
[clvmd pidfile [[PID_DIR/clvmd.pid]]]),
2010-07-13 17:51:01 +04:00
CLVMD_PIDFILE=$withval,
2012-06-21 16:41:52 +04:00
CLVMD_PIDFILE="$DEFAULT_PID_DIR/clvmd.pid")
2010-07-13 17:51:01 +04:00
AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
[Path to clvmd pidfile.])
fi
2009-08-13 20:34:07 +04:00
################################################################################
2009-08-29 00:51:40 +04:00
dnl -- Build cluster mirror log daemon
AC_MSG_CHECKING(whether to build cluster mirror log daemon)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(cmirrord,
AC_HELP_STRING([--enable-cmirrord],
[enable the cluster mirror log daemon]),
CMIRRORD=$enableval, CMIRRORD=no)
2009-08-29 00:51:40 +04:00
AC_MSG_RESULT($CMIRRORD)
2009-08-13 20:34:07 +04:00
2009-08-29 00:51:40 +04:00
BUILD_CMIRRORD=$CMIRRORD
################################################################################
dnl -- cmirrord pidfile
2014-06-05 19:28:03 +04:00
if test "$BUILD_CMIRRORD" = yes; then
2009-08-29 00:51:40 +04:00
AC_ARG_WITH(cmirrord-pidfile,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-cmirrord-pidfile=PATH],
2012-06-21 16:41:52 +04: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.])
2009-08-29 00:51:40 +04:00
fi
################################################################################
2009-08-13 20:34:07 +04:00
dnl -- Look for corosync libraries if required.
2014-06-05 19:28:03 +04:00
if [[ "$BUILD_CMIRRORD" = yes ]]; then
pkg_config_init
2012-03-01 01:15:34 +04:00
AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
[AC_MSG_RESULT([no libSaCkpt, compiling without it])
AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
2014-06-06 12:29:47 +04:00
if test "$HAVE_CPG" != yes; then
PKG_CHECK_MODULES(CPG, libcpg)
fi
2009-08-13 20:34:07 +04:00
fi
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Enable debugging
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to enable debugging)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]),
DEBUG=$enableval, DEBUG=no)
2004-07-03 22:21:13 +04:00
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
2014-06-05 19:28:03 +04:00
if test "$DEBUG" = yes; then
2004-06-29 17:29:25 +04:00
COPTIMISE_FLAG=
2006-04-19 19:33:07 +04:00
else
CSCOPE_CMD=
2004-06-29 17:29:25 +04:00
fi
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)
2013-10-24 23:40:25 +04:00
2004-06-29 17:29:25 +04:00
################################################################################
dnl -- Override optimisation
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(for C optimisation flag)
2004-06-29 17:29:25 +04:00
AC_ARG_WITH(optimisation,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-optimisation=OPT],
[C optimisation flag [[OPT=-O2]]]),
COPTIMISE_FLAG=$withval)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($COPTIMISE_FLAG)
2004-06-29 17:29:25 +04:00
2008-06-27 19:35:09 +04:00
################################################################################
dnl -- Enable profiling
2008-06-27 23:24:17 +04:00
AC_MSG_CHECKING(whether to gather gcov profiling data)
2008-06-27 19:35:09 +04:00
AC_ARG_ENABLE(profiling,
2014-06-05 19:28:03 +04:00
AC_HELP_STRING([--enable-profiling],
[gather gcov profiling data]),
2010-07-08 16:02:48 +04:00
PROFILING=$enableval, PROFILING=no)
2008-06-27 23:24:17 +04:00
AC_MSG_RESULT($PROFILING)
2014-06-05 19:28:03 +04:00
if test "$PROFILING" = yes; then
2008-06-27 23:24:17 +04:00
COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(LCOV, lcov)
AC_PATH_TOOL(GENHTML, genhtml)
test -z "$LCOV" -o -z "$GENHTML" && AC_MSG_ERROR([lcov and genhtml are required for profiling])
AC_PATH_TOOL(GENPNG, genpng)
2010-04-06 15:53:53 +04:00
if test -n "$GENPNG"; then
AC_MSG_CHECKING([whether $GENPNG has all required modules])
2014-06-05 19:28:03 +04:00
if "$GENPNG" --help > /dev/null 2>&1 ; then
2010-04-06 15:53:53 +04:00
AC_MSG_RESULT(ok)
GENHTML="$GENHTML --frames"
else
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=
fi
fi
2008-06-27 23:24:17 +04:00
fi
2008-06-27 19:35:09 +04:00
2010-07-20 18:38:44 +04:00
################################################################################
dnl -- Enable testing
AC_MSG_CHECKING(whether to enable unit testing)
AC_ARG_ENABLE(testing,
2014-06-06 12:29:47 +04:00
AC_HELP_STRING([--enable-testing],
2014-06-05 19:28:03 +04:00
[enable testing targets in the makefile]),
TESTING=$enableval, TESTING=no)
2010-07-20 18:38:44 +04:00
AC_MSG_RESULT($TESTING)
if test "$TESTING" = yes; then
2014-06-05 19:28:03 +04:00
pkg_config_init
2011-12-11 19:15:57 +04:00
PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
2010-07-20 18:38:44 +04:00
fi
2010-08-09 14:56:01 +04:00
################################################################################
dnl -- Enable valgrind awareness of memory pools
AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
AC_ARG_ENABLE(valgrind_pool,
2014-06-06 12:29:47 +04:00
AC_HELP_STRING([--enable-valgrind-pool],
2014-06-05 19:28:03 +04:00
[enable valgrind awareness of pools]),
2010-08-09 14:56:01 +04:00
VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
AC_MSG_RESULT($VALGRIND_POOL)
if test "$VALGRIND_POOL" = yes; then
2014-06-05 19:28:03 +04:00
pkg_config_init
PKG_CHECK_MODULES(VALGRIND, valgrind, [], [AC_MSG_ERROR(bailing out)])
AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
AC_SUBST(VALGRIND_POOL)
AC_SUBST(VALGRIND_CFLAGS)
2010-08-09 14:56:01 +04:00
fi
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Disable devmapper
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to use device-mapper)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(devmapper,
AC_HELP_STRING([--disable-devmapper],
[disable LVM2 device-mapper interaction]),
DEVMAPPER=$enableval)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($DEVMAPPER)
2003-01-09 01:44:07 +03:00
2014-06-05 19:28:03 +04:00
if test "$DEVMAPPER" = yes; then
2008-11-01 01:06:09 +03:00
AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
2003-04-15 17:24:42 +04:00
fi
2011-08-31 15:31:57 +04:00
################################################################################
dnl -- Build lvmetad
AC_MSG_CHECKING(whether to build LVMetaD)
AC_ARG_ENABLE(lvmetad,
2012-01-23 21:48:18 +04:00
AC_HELP_STRING([--enable-lvmetad],
[enable the LVM Metadata Daemon]),
2011-08-31 15:31:57 +04:00
LVMETAD=$enableval)
AC_MSG_RESULT($LVMETAD)
BUILD_LVMETAD=$LVMETAD
2014-06-05 19:28:03 +04:00
if test "$BUILD_LVMETAD" = yes; then
2012-02-28 22:18:48 +04:00
AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
2012-06-21 16:41:52 +04:00
AC_ARG_WITH(lvmetad-pidfile,
AC_HELP_STRING([--with-lvmetad-pidfile=PATH],
[lvmetad pidfile [[PID_DIR/lvmetad.pid]]]),
LVMETAD_PIDFILE=$withval,
LVMETAD_PIDFILE="$DEFAULT_PID_DIR/lvmetad.pid")
AC_DEFINE_UNQUOTED(LVMETAD_PIDFILE, ["$LVMETAD_PIDFILE"],
[Path to lvmetad pidfile.])
2012-02-28 22:18:48 +04:00
fi
2013-11-14 17:03:24 +04:00
################################################################################
dnl -- Enable blkid wiping functionality
2013-11-29 18:27:56 +04:00
AC_MSG_CHECKING(whether to enable libblkid detection of signatures when wiping)
AC_ARG_ENABLE(blkid_wiping,
AC_HELP_STRING([--disable-blkid_wiping],
[disable libblkid detection of signatures when wiping and use native code instead]),
BLKID_WIPING=$enableval, BLKID_WIPING=maybe)
2013-11-14 17:03:24 +04:00
AC_MSG_RESULT($BLKID_WIPING)
2014-06-05 19:28:03 +04:00
if test "$BLKID_WIPING" != no; then
pkg_config_init
2013-11-29 19:37:09 +04:00
PKG_CHECK_MODULES(BLKID, blkid >= 2.24,
2014-06-05 19:28:03 +04:00
[test "$BLKID_WIPING" = maybe && BLKID_WIPING=yes],
[if test "$BLKID_WIPING" = maybe; then
BLKID_WIPING=no
else
AC_MSG_ERROR([bailing out... blkid library >= 2.24 is required])
fi])
if test "$BLKID_WIPING" = yes; then
2013-11-29 18:27:56 +04:00
BLKID_PC="blkid"
AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
fi
2013-11-14 17:03:24 +04:00
fi
2013-10-18 13:07:21 +04:00
################################################################################
dnl -- Enable udev-systemd protocol to instantiate a service for background jobs
AC_MSG_CHECKING(whether to use udev-systemd protocol for jobs in background)
AC_ARG_ENABLE(udev-systemd-background-jobs,
2014-04-16 13:33:44 +04:00
AC_HELP_STRING([--disable-udev-systemd-background-jobs],
[disable udev-systemd protocol to instantiate a service for background job]),
UDEV_SYSTEMD_BACKGROUND_JOBS=$enableval, UDEV_SYSTEMD_BACKGROUND_JOBS=yes)
2013-10-18 13:07:21 +04:00
AC_MSG_RESULT($UDEV_SYSTEMD_BACKGROUND_JOBS)
2009-07-31 15:49:53 +04:00
################################################################################
dnl -- Enable udev synchronisation
AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(udev_sync,
2014-06-05 19:28:03 +04:00
AC_HELP_STRING([--enable-udev_sync],
2010-07-08 16:02:48 +04:00
[enable synchronisation with udev processing]),
UDEV_SYNC=$enableval, UDEV_SYNC=no)
2009-07-31 15:49:53 +04:00
AC_MSG_RESULT($UDEV_SYNC)
2014-06-05 19:28:03 +04:00
if test "$UDEV_SYNC" = yes; then
pkg_config_init
2011-04-22 15:56:41 +04:00
PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
2009-07-31 15:49:53 +04:00
AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
fi
dnl -- Enable udev rules
AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(udev_rules,
AC_HELP_STRING([--enable-udev_rules],
[install rule files needed for udev synchronisation]),
UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
2009-07-31 15:49:53 +04:00
AC_MSG_RESULT($UDEV_RULES)
2012-06-22 13:50:02 +04:00
AC_MSG_CHECKING(whether to enable executable path detection in udev rules)
AC_ARG_ENABLE(udev_rule_exec_detection,
AC_HELP_STRING([--enable-udev-rule-exec-detection],
[enable executable path detection in udev rules]),
UDEV_RULE_EXEC_DETECTION=$enableval, UDEV_RULE_EXEC_DETECTION=no)
AC_MSG_RESULT($UDEV_RULE_EXEC_DETECTION)
dnl -- Check support for built-in blkid against target udev version
2014-06-05 19:28:03 +04:00
if test "$UDEV_RULE" != no ; then
AC_MSG_CHECKING(whether udev supports built-in blkid)
pkg_config_init
if $("$PKG_CONFIG" --atleast-version=176 libudev); then
UDEV_HAS_BUILTIN_BLKID=yes
else
UDEV_HAS_BUILTIN_BLKID=no
fi
AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
2012-02-20 23:36:27 +04:00
fi
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Compatibility mode
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(compat,
AC_HELP_STRING([--enable-compat],
[enable support for old device-mapper versions]),
DM_COMPAT=$enableval, DM_COMPAT=no)
2008-11-01 01:06:09 +03:00
2014-06-05 19:28:03 +04:00
if test "$DM_COMPAT" = yes; then
AC_MSG_ERROR([--enable-compat is not currently supported.
Since device-mapper version 1.02.66, only one version (4) of the device-mapper
ioctl protocol is supported.])
2011-08-09 21:56:47 +04:00
fi
2009-09-28 20:23:44 +04:00
################################################################################
dnl -- Compatible units suffix mode
AC_ARG_ENABLE(units-compat,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--enable-units-compat],
[enable output compatibility with old versions that
that do not use KiB-style unit suffixes]),
UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
2009-09-28 20:23:44 +04:00
2014-06-05 19:28:03 +04:00
if test "$UNITS_COMPAT" = yes; then
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.])
fi
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Disable ioctl
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(ioctl,
2014-04-29 14:44:32 +04:00
AC_HELP_STRING([--disable-ioctl],
[disable ioctl calls to device-mapper in the kernel]),
2010-07-08 16:02:48 +04:00
DM_IOCTLS=$enableval)
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
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to enable O_DIRECT)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(o_direct,
AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]),
ODIRECT=$enableval)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($ODIRECT)
2003-11-06 20:14:06 +03:00
2014-06-05 19:28:03 +04:00
if test "$ODIRECT" = yes; then
2006-05-10 01:23:51 +04:00
AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2003-11-06 20:14:06 +03:00
fi
2009-05-22 18:44:59 +04:00
################################################################################
dnl -- Enable liblvm2app.so
AC_MSG_CHECKING(whether to build liblvm2app.so application library)
AC_ARG_ENABLE(applib,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--enable-applib], [build application library]),
APPLIB=$enableval, APPLIB=no)
2009-05-22 18:44:59 +04:00
AC_MSG_RESULT($APPLIB)
AC_SUBST([LVM2APP_LIB])
2014-06-05 19:28:03 +04:00
test "$APPLIB" = yes \
2009-05-22 18:44:59 +04:00
&& LVM2APP_LIB=-llvm2app \
|| LVM2APP_LIB=
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Enable cmdlib
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(cmdlib,
AC_HELP_STRING([--enable-cmdlib], [build shared command library]),
CMDLIB=$enableval, CMDLIB=no)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($CMDLIB)
2008-06-23 13:25:08 +04:00
AC_SUBST([LVM2CMD_LIB])
2014-06-05 19:28:03 +04:00
test "$CMDLIB" = yes \
2008-06-23 13:25:08 +04:00
&& LVM2CMD_LIB=-llvm2cmd \
|| LVM2CMD_LIB=
2004-03-26 17:17:14 +03:00
2012-10-12 05:08:47 +04:00
################################################################################
dnl -- Enable Python liblvm2app bindings
AC_MSG_CHECKING(whether to build Python wrapper for liblvm2app.so)
AC_ARG_ENABLE(python_bindings,
AC_HELP_STRING([--enable-python_bindings], [build Python applib bindings]),
PYTHON_BINDINGS=$enableval, PYTHON_BINDINGS=no)
AC_MSG_RESULT($PYTHON_BINDINGS)
2014-06-05 19:28:03 +04:00
if test "$PYTHON_BINDINGS" = yes; then
test "$APPLIB" != yes && AC_MSG_ERROR([--enable-python_bindings requires --enable-applib])
2012-10-12 05:08:47 +04:00
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(PYTHON, python)
test -z "$PYTHON" && AC_MSG_ERROR([python is required for --enable-python_bindings but cannot be found])
2012-10-12 05:08:47 +04:00
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(PYTHON_CONFIG, python-config)
test -z "$PYTHON_CONFIG" && AC_MSG_ERROR([python headers are required for --enable-python_bindings but cannot be found])
2012-10-12 05:08:47 +04:00
2014-06-05 19:28:03 +04:00
PYTHON_INCDIRS=`"$PYTHON_CONFIG" --includes`
PYTHON_LIBDIRS=`"$PYTHON_CONFIG" --libs`
2012-10-12 05:08:47 +04:00
fi
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Enable pkg-config
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(pkgconfig,
AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]),
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,
AC_HELP_STRING([--enable-write_install],
[install user writable files]),
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
2007-12-17 15:23:24 +03:00
AC_MSG_CHECKING(whether to install fsadm)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]),
FSADM=$enableval)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($FSADM)
2004-06-20 17:38:54 +04:00
2012-10-12 16:37:57 +04:00
################################################################################
dnl -- Enable blkdeactivate
AC_MSG_CHECKING(whether to install blkdeactivate)
AC_ARG_ENABLE(blkdeactivate, AC_HELP_STRING([--disable-blkdeactivate], [disable blkdeactivate]),
BLKDEACTIVATE=$enableval)
AC_MSG_RESULT($BLKDEACTIVATE)
2005-12-02 22:52:06 +03:00
################################################################################
dnl -- enable dmeventd handling
AC_MSG_CHECKING(whether to use dmeventd)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd],
[enable the device-mapper event daemon]),
DMEVENTD=$enableval)
2005-12-02 22:52:06 +03:00
AC_MSG_RESULT($DMEVENTD)
2008-11-01 01:06:09 +03:00
BUILD_DMEVENTD=$DMEVENTD
2005-12-02 22:52:06 +03:00
dnl -- dmeventd currently requires internal mirror support
2014-06-05 19:28:03 +04:00
if test "$DMEVENTD" = yes; then
if test "$MIRRORS" != internal; then
AC_MSG_ERROR([--enable-dmeventd currently requires --with-mirrors=internal])
2008-07-09 13:59:42 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$CMDLIB" = no; then
AC_MSG_ERROR([--enable-dmeventd requires --enable-cmdlib to be used as well])
2008-07-09 13:59:42 +04:00
fi
2005-12-02 22:52:06 +03:00
2014-06-05 19:28:03 +04:00
AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
2005-12-02 23:35:07 +03:00
fi
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- getline included in recent libc
AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
[Define to 1 if getline is available.]))
################################################################################
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
################################################################################
2008-06-13 18:37:18 +04:00
dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
2014-06-05 19:28:03 +04:00
test "$exec_prefix" = NONE -a "$prefix" = NONE && exec_prefix=""
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 -- 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"
HAVE_LIBDL=yes],
[DL_LIBS=
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
2014-06-05 19:28:03 +04:00
if [[ \( "$LVM1" = shared -o "$POOL" = shared -o "$CLUSTER" = shared \
-o "$SNAPSHOTS" = shared -o "$MIRRORS" = shared \
-o "$RAID" = shared -o "$CACHE" = shared \
\) -a "$STATIC_LINK" = yes ]]; then
AC_MSG_ERROR([Features cannot be 'shared' when building statically])
2004-04-07 18:08:22 +04:00
fi
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
AC_MSG_CHECKING(whether to enable selinux support)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(selinux,
AC_HELP_STRING([--disable-selinux], [disable selinux support]),
SELINUX=$enableval)
2008-06-13 18:37:18 +04:00
AC_MSG_RESULT($SELINUX)
2004-06-28 18:01:24 +04:00
################################################################################
2006-04-19 19:33:07 +04:00
dnl -- Check for selinux
2014-06-05 19:28:03 +04:00
if test "$SELINUX" = yes; then
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.])
SELINUX_LIBS="-lsepol"])
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.])
2009-10-05 16:11:30 +04:00
SELINUX_LIBS="-lselinux $SELINUX_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=
2010-05-11 12:48:43 +04:00
SELINUX_PC=
2010-03-04 15:08:26 +03:00
HAVE_SELINUX=no ])
2004-04-07 18:08:22 +04:00
fi
2004-04-05 20:29:37 +04:00
2006-10-01 00:02:02 +04:00
################################################################################
dnl -- Check for realtime clock support
2014-06-05 19:28:03 +04:00
if test "$REALTIME" = yes; then
2006-10-01 00:02:02 +04:00
AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
2014-06-05 19:28:03 +04:00
if test "$HAVE_REALTIME" = yes; then
2006-10-01 00:02:02 +04:00
AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
LIBS="-lrt $LIBS"
else
AC_MSG_WARN(Disabling realtime clock)
fi
fi
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
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)
2014-03-06 19:00:04 +04:00
if test "$READLINE" != no; then
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, [
if test "$READLINE" = yes; then
AC_MSG_ERROR(
[termcap could not be found which is required for the
--enable-readline option (which is enabled by default). Either disable readline
support with --disable-readline or download and install termcap from:
ftp.gnu.org/gnu/termcap
Note: if you are using precompiled packages you will also need the development
package as well (which may be called termcap-devel or something similar).
Note: (n)curses also seems to work as a substitute for termcap. This was
not found either - but you could try installing that as well.])
fi])
dnl -- Old systems may need extra termcap dependency explicitly in LIBS
AC_CHECK_LIB([readline], [readline], [
AC_DEFINE([READLINE_SUPPORT], 1,
[Define to 1 to include the LVM readline shell.])
dnl -- Try only with -lreadline and check for different symbol
LIBS=$lvm_saved_libs
AC_CHECK_LIB([readline], [rl_line_buffer],
[ READLINE_LIBS="-lreadline" ], [
AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
READLINE_LIBS="-lreadline $READLINE_LIBS"
]) ], [
READLINE_LIBS=
if test "$READLINE" = yes; then
AC_MSG_ERROR(
[GNU Readline could not be found which is required for the
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).])
fi ])
LIBS="$READLINE_LIBS $lvm_saved_libs"
AC_CHECK_FUNCS([rl_completion_matches])
LIBS=$lvm_saved_libs
2001-09-21 16:37:43 +04:00
fi
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Internationalisation stuff
2004-07-03 22:21:13 +04:00
AC_MSG_CHECKING(whether to enable internationalisation)
2010-07-08 16:02:48 +04:00
AC_ARG_ENABLE(nls,
AC_HELP_STRING([--enable-nls], [enable Native Language Support]),
INTL=$enableval, INTL=no)
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($INTL)
2004-02-14 01:56:45 +03:00
2014-06-05 19:28:03 +04:00
if test "$INTL" = yes; then
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)
if [[ -z "$MSGFMT" ]]; then
AC_MSG_ERROR([msgfmt not found in path $PATH])
fi
2004-02-14 01:56:45 +03:00
AC_ARG_WITH(localedir,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-localedir=DIR],
[translation files in DIR
[[PREFIX/share/locale]]]),
LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale')
2004-02-14 01:56:45 +03:00
fi
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,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-confdir=DIR],
[configuration files in DIR [[/etc]]]),
2013-07-04 13:52:25 +04:00
CONFDIR=$withval, CONFDIR='/etc')
2004-04-14 22:00:23 +04:00
AC_ARG_WITH(staticdir,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-staticdir=DIR],
[static binaries in DIR [[EPREFIX/sbin]]]),
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,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-usrlibdir=DIR],
[usrlib in DIR [[PREFIX/lib]]]),
usrlibdir=$withval, usrlibdir='${prefix}/lib')
2008-10-07 23:11:59 +04:00
AC_ARG_WITH(usrsbindir,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-usrsbindir=DIR],
[usrsbin executables in DIR [[PREFIX/sbin]]]),
usrsbindir=$withval, usrsbindir='${prefix}/sbin')
2008-10-07 23:11:59 +04:00
2009-07-31 15:49:53 +04:00
################################################################################
AC_ARG_WITH(udev_prefix,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-udev-prefix=UPREFIX],
[install udev rule files in UPREFIX [[EPREFIX]]]),
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,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-udevdir=DIR],
[udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]),
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,
AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
[systemd service files in DIR]),
systemdsystemunitdir=$withval,
2014-06-05 19:28:03 +04:00
pkg_config_init
pkg_systemdsystemunitdir=$("$PKG_CONFIG" --variable=systemdsystemunitdir systemd))
2012-02-13 17:02:47 +04:00
2014-06-05 19:28:03 +04:00
test -n "$pkg_systemdsystemunitdir" && systemdsystemunitdir=$pkg_systemdsystemunitdir
test -z "$systemdsystemunitdir" && systemdsystemunitdir='${exec_prefix}/lib/systemd/system';
2012-02-13 17:02:47 +04:00
2014-06-05 19:28:03 +04:00
systemdutildir=$("$PKG_CONFIG" --variable=systemdutildir systemd)
test -z "$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,
AC_HELP_STRING([--with-tmpfilesdir=DIR],
2012-07-16 13:13:32 +04:00
[install configuration files for management of volatile files and directories in DIR [[PREFIX/lib/tmpfiles.d]]]),
tmpfilesdir=$withval, tmpfilesdir='${prefix}/lib/tmpfiles.d')
2012-02-22 21:55:10 +04:00
################################################################################
2004-07-03 22:21:13 +04:00
dnl -- Ensure additional headers required
2014-06-05 19:28:03 +04:00
if test "$READLINE" = yes; then
AC_CHECK_HEADERS(readline/readline.h readline/history.h,,hard_bailout)
2004-07-03 22:21:13 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$CLVMD" != none; then
2004-07-03 22:21:13 +04:00
AC_CHECK_HEADERS(mntent.h netdb.h netinet/in.h pthread.h search.h sys/mount.h sys/socket.h sys/uio.h sys/un.h utmpx.h,,AC_MSG_ERROR(bailing out))
2014-06-05 19:28:03 +04:00
AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,hard_bailout)
2004-07-03 22:21:13 +04:00
AC_FUNC_GETMNTENT
AC_FUNC_SELECT_ARGTYPES
fi
2014-06-05 19:28:03 +04:00
if test "$CLUSTER" != none; then
AC_CHECK_HEADERS(sys/socket.h sys/un.h,,hard_bailout)
AC_CHECK_FUNCS(socket,,hard_bailout)
2004-07-03 22:21:13 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$DMEVENTD" = yes; then
AC_CHECK_HEADERS(arpa/inet.h,,hard_bailout)
2010-07-06 02:23:15 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$HAVE_LIBDL" = yes; then
AC_CHECK_HEADERS(dlfcn.h,,hard_bailout)
2004-07-03 22:21:13 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$INTL" = yes; then
AC_CHECK_HEADERS(libintl.h,,hard_bailout)
2004-07-03 22:21:13 +04:00
fi
2014-06-05 19:28:03 +04:00
if test "$UDEV_SYNC" = yes; then
AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,hard_bailout)
2009-07-31 15:49:53 +04:00
fi
2005-10-17 21:56:27 +04:00
################################################################################
2014-06-05 19:28:03 +04:00
AC_PATH_TOOL(MODPROBE_CMD, modprobe)
2005-10-17 21:56:27 +04:00
2014-06-05 19:28:03 +04:00
if test -n "$MODPROBE_CMD"; then
2006-05-10 01:23:51 +04:00
AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
2005-10-17 21:56:27 +04:00
fi
2010-06-07 18:31:59 +04:00
lvm_exec_prefix=$exec_prefix
test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
2011-09-25 00:50:35 +04:00
LVM_PATH="$lvm_exec_prefix/sbin/lvm"
AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
2010-06-03 17:50:26 +04:00
if test "$CLVMD" != none; then
2014-06-05 19:28:03 +04:00
clvmd_prefix=$ac_default_prefix
CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
test "$prefix" != NONE && clvmd_prefix=$prefix
2011-09-25 00:50:35 +04:00
AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
2010-06-03 17:50:26 +04:00
fi
2004-06-28 18:01:24 +04:00
################################################################################
2008-11-01 01:06:09 +03:00
dnl -- dmeventd pidfile and executable path
if test "$BUILD_DMEVENTD" = yes; then
AC_ARG_WITH(dmeventd-pidfile,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-dmeventd-pidfile=PATH],
2012-06-21 16:41:52 +04:00
[dmeventd pidfile [[PID_DIR/dmeventd.pid]]]),
2010-07-08 16:02:48 +04:00
DMEVENTD_PIDFILE=$withval,
2012-06-21 16:41:52 +04:00
DMEVENTD_PIDFILE="$DEFAULT_PID_DIR/dmeventd.pid")
2010-07-08 16:02:48 +04:00
AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
[Path to dmeventd pidfile.])
2008-11-01 01:06:09 +03:00
fi
if test "$BUILD_DMEVENTD" = yes; then
AC_ARG_WITH(dmeventd-path,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-dmeventd-path=PATH],
[dmeventd path [[EPREFIX/sbin/dmeventd]]]),
DMEVENTD_PATH=$withval,
DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd")
AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"],
[Path to dmeventd binary.])
2008-11-01 01:06:09 +03:00
fi
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,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-default-system-dir=DIR],
2013-07-04 13:52:25 +04:00
[default LVM system directory [[/etc/lvm]]]),
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,
AC_HELP_STRING([--with-default-profile-subdir=SUBDIR],
[default configuration profile subdir [[profile]]]),
DEFAULT_PROFILE_SUBDIR=$withval, DEFAULT_PROFILE_SUBDIR=profile)
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,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-default-archive-subdir=SUBDIR],
[default metadata archive subdir [[archive]]]),
DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive)
AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"],
[Name of default metadata archive subdirectory.])
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-backup-subdir,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-default-backup-subdir=SUBDIR],
[default metadata backup subdir [[backup]]]),
DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup)
AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"],
[Name of default metadata backup subdirectory.])
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-cache-subdir,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-default-cache-subdir=SUBDIR],
[default metadata cache subdir [[cache]]]),
DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache)
AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"],
[Name of default metadata cache subdirectory.])
2010-05-20 17:47:21 +04:00
AC_ARG_WITH(default-locking-dir,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-default-locking-dir=DIR],
[default locking directory [[/var/lock/lvm]]]),
DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm")
AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
[Name of default locking directory.])
2010-05-20 17:47:21 +04:00
2010-08-21 02:24:58 +04:00
################################################################################
dnl -- Setup default data alignment
AC_ARG_WITH(default-data-alignment,
AC_HELP_STRING([--with-default-data-alignment=NUM],
[set the default data alignment in MiB [[1]]]),
DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1)
AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT],
[Default data alignment.])
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- which kernel interface to use (ioctl only)
AC_MSG_CHECKING(for kernel interface choice)
AC_ARG_WITH(interface,
2010-07-08 16:02:48 +04:00
AC_HELP_STRING([--with-interface=IFACE],
[choose kernel interface (ioctl) [[ioctl]]]),
interface=$withval, interface=ioctl)
2014-06-05 19:28:03 +04:00
test "$interface" != ioctl && AC_MSG_ERROR([--with-interface=ioctl required. fs no longer supported.])
2008-11-01 01:06:09 +03:00
AC_MSG_RESULT($interface)
################################################################################
2009-10-02 23:10:31 +04:00
DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
2008-11-01 04:43:31 +03:00
AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
2009-10-02 23:10:31 +04:00
DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
2008-11-01 23:48:09 +03:00
2009-10-02 23:10:31 +04:00
LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
2002-01-17 19:39:24 +03:00
2009-10-02 23:10:31 +04:00
VER=`cat "$srcdir"/VERSION`
2009-07-23 00:01:28 +04:00
LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
2009-02-23 01:11:58 +03:00
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}'`
2009-07-23 00:01:28 +04:00
LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
2009-02-23 01:11:58 +03:00
2004-06-28 18:01:24 +04:00
################################################################################
2009-05-22 18:44:59 +04:00
AC_SUBST(APPLIB)
2010-04-30 17:58:08 +04:00
AC_SUBST(AWK)
2013-11-14 17:03:24 +04:00
AC_SUBST(BLKID_PC)
AC_SUBST(BLKID_WIPING)
2009-08-29 00:51:40 +04:00
AC_SUBST(BUILD_CMIRRORD)
2008-06-13 18:37:18 +04:00
AC_SUBST(BUILD_DMEVENTD)
2011-08-31 15:31:57 +04:00
AC_SUBST(BUILD_LVMETAD)
2014-01-27 15:27:16 +04:00
AC_SUBST(CACHE)
2003-04-15 17:24:42 +04:00
AC_SUBST(CFLAGS)
2008-06-13 18:37:18 +04:00
AC_SUBST(CFLOW_CMD)
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(CLUSTER)
AC_SUBST(CLVMD)
2010-08-23 15:37:02 +04:00
AC_SUBST(CLVMD_CMANAGERS)
2011-09-25 00:50:35 +04:00
AC_SUBST(CLVMD_PATH)
2009-08-28 23:22:05 +04:00
AC_SUBST(CMAN_CFLAGS)
AC_SUBST(CMAN_LIBS)
2012-02-01 01:21:53 +04:00
AC_SUBST(CMAP_CFLAGS)
AC_SUBST(CMAP_LIBS)
2008-06-13 18:37:18 +04:00
AC_SUBST(CMDLIB)
2009-02-26 01:41:12 +03:00
AC_SUBST(CONFDB_CFLAGS)
AC_SUBST(CONFDB_LIBS)
AC_SUBST(CONFDIR)
2008-06-13 18:37:18 +04:00
AC_SUBST(COPTIMISE_FLAG)
2009-02-26 01:41:12 +03:00
AC_SUBST(CPG_CFLAGS)
AC_SUBST(CPG_LIBS)
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_SYS_DIR)
AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
AC_SUBST(DEFAULT_BACKUP_SUBDIR)
AC_SUBST(DEFAULT_CACHE_SUBDIR)
2013-06-25 14:26:40 +04:00
AC_SUBST(DEFAULT_PROFILE_SUBDIR)
2010-08-21 02:24:58 +04:00
AC_SUBST(DEFAULT_DATA_ALIGNMENT)
2010-05-20 17:47:21 +04:00
AC_SUBST(DEFAULT_LOCK_DIR)
2012-06-21 16:41:52 +04:00
AC_SUBST(DEFAULT_DM_RUN_DIR)
2014-04-23 16:31:42 +04:00
AC_SUBST(DEFAULT_PID_DIR)
2010-07-31 04:43:41 +04:00
AC_SUBST(DEFAULT_RUN_DIR)
2003-01-09 01:44:07 +03:00
AC_SUBST(DEVMAPPER)
2009-08-28 23:22:05 +04:00
AC_SUBST(DLM_CFLAGS)
AC_SUBST(DLM_LIBS)
2010-03-04 15:10:40 +03:00
AC_SUBST(DL_LIBS)
2008-06-13 18:37:18 +04:00
AC_SUBST(DMEVENTD)
2010-08-17 02:54:35 +04:00
AC_SUBST(DMEVENTD_PATH)
2008-06-13 18:37:18 +04:00
AC_SUBST(DM_COMPAT)
AC_SUBST(DM_DEVICE_GID)
AC_SUBST(DM_DEVICE_MODE)
AC_SUBST(DM_DEVICE_UID)
AC_SUBST(DM_IOCTLS)
AC_SUBST(DM_LIB_VERSION)
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)
2012-10-12 16:37:57 +04:00
AC_SUBST(BLKDEACTIVATE)
2003-03-24 21:08:53 +03:00
AC_SUBST(HAVE_LIBDL)
2006-10-01 00:02:02 +04:00
AC_SUBST(HAVE_REALTIME)
2008-06-13 18:37:18 +04:00
AC_SUBST(INTL)
AC_SUBST(INTL_PACKAGE)
AC_SUBST(JOBS)
AC_SUBST(LDDEPS)
AC_SUBST(LIBS)
AC_SUBST(LIB_SUFFIX)
2004-02-14 01:56:45 +03:00
AC_SUBST(LOCALEDIR)
2008-06-13 18:37:18 +04:00
AC_SUBST(LVM1)
AC_SUBST(LVM1_FALLBACK)
AC_SUBST(LVM_VERSION)
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)
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)
2010-11-05 19:18:38 +03:00
AC_SUBST(OCF)
2011-01-10 16:00:53 +03:00
AC_SUBST(OCFDIR)
2008-06-13 18:37:18 +04:00
AC_SUBST(PKGCONFIG)
AC_SUBST(POOL)
2010-03-04 14:21:05 +03:00
AC_SUBST(PTHREAD_LIBS)
2012-10-12 05:08:47 +04:00
AC_SUBST(PYTHON)
AC_SUBST(PYTHON_BINDINGS)
AC_SUBST(PYTHON_INCDIRS)
AC_SUBST(PYTHON_LIBDIRS)
2009-02-26 01:41:12 +03:00
AC_SUBST(QUORUM_CFLAGS)
AC_SUBST(QUORUM_LIBS)
2011-08-03 02:07:20 +04:00
AC_SUBST(RAID)
2010-03-04 14:19:15 +03:00
AC_SUBST(READLINE_LIBS)
2011-08-03 02:07:20 +04:00
AC_SUBST(REPLICATORS)
2009-09-15 02:57:46 +04:00
AC_SUBST(SACKPT_CFLAGS)
AC_SUBST(SACKPT_LIBS)
2009-08-28 23:22:05 +04:00
AC_SUBST(SALCK_CFLAGS)
AC_SUBST(SALCK_LIBS)
2009-10-05 16:11:30 +04:00
AC_SUBST(SELINUX_LIBS)
2010-05-11 12:48:43 +04:00
AC_SUBST(SELINUX_PC)
2008-06-13 18:37:18 +04:00
AC_SUBST(SNAPSHOTS)
2004-04-14 22:00:23 +04:00
AC_SUBST(STATICDIR)
2008-06-13 18:37:18 +04:00
AC_SUBST(STATIC_LINK)
2010-07-20 18:38:44 +04:00
AC_SUBST(TESTING)
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)
2014-07-04 18:31:29 +04:00
AC_SUBST(CACHE_CHECK_CMD)
AC_SUBST(CACHE_DUMP_CMD)
AC_SUBST(CACHE_REPAIR_CMD)
AC_SUBST(CACHE_RESTORE_CMD)
2010-05-11 12:48:43 +04:00
AC_SUBST(UDEV_PC)
2009-07-31 15:49:53 +04:00
AC_SUBST(UDEV_RULES)
2010-01-11 18:48:49 +03:00
AC_SUBST(UDEV_SYNC)
2013-10-18 13:07:21 +04:00
AC_SUBST(UDEV_SYSTEMD_BACKGROUND_JOBS)
2012-06-22 13:50:02 +04:00
AC_SUBST(UDEV_RULE_EXEC_DETECTION)
2012-02-20 23:36:27 +04:00
AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
2010-04-10 01:42:48 +04:00
AC_SUBST(WRITE_INSTALL)
2011-07-28 16:57:26 +04:00
AC_SUBST(DMEVENTD_PIDFILE)
2012-06-21 16:41:52 +04:00
AC_SUBST(LVMETAD_PIDFILE)
2013-06-07 16:07:56 +04:00
AC_SUBST(CLVMD_PIDFILE)
AC_SUBST(CMIRRORD_PIDFILE)
2008-11-01 01:06:09 +03:00
AC_SUBST(interface)
AC_SUBST(kerneldir)
AC_SUBST(missingkernel)
AC_SUBST(kernelvsn)
AC_SUBST(tmpdir)
2009-07-31 15:49:53 +04:00
AC_SUBST(udev_prefix)
AC_SUBST(udevdir)
2012-02-13 17:02:47 +04:00
AC_SUBST(systemdsystemunitdir)
2012-07-31 18:46:24 +04:00
AC_SUBST(systemdutildir)
2012-02-22 21:55:10 +04:00
AC_SUBST(tmpfilesdir)
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
daemons/Makefile
daemons/clvmd/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
2011-08-31 15:31:57 +04:00
daemons/lvmetad/Makefile
2013-06-28 12:46:00 +04:00
conf/Makefile
conf/example.conf
2014-05-21 14:32:12 +04:00
conf/command_profile_template.profile
conf/metadata_profile_template.profile
2009-10-02 23:10:31 +04:00
include/.symlinks
2008-11-01 01:06:09 +03:00
include/Makefile
lib/Makefile
2007-09-18 22:26:32 +04:00
lib/format1/Makefile
lib/format_pool/Makefile
lib/locking/Makefile
lib/mirror/Makefile
2010-05-21 16:36:30 +04:00
lib/replicator/Makefile
2009-02-23 01:11:58 +03:00
lib/misc/lvm-version.h
2011-08-11 23:18:17 +04:00
lib/raid/Makefile
2007-09-18 22:26:32 +04:00
lib/snapshot/Makefile
2011-08-24 12:27:49 +04:00
lib/thin/Makefile
2014-01-27 15:27:16 +04:00
lib/cache_segtype/Makefile
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
libdm/libdevmapper.pc
2009-03-06 19:19:52 +03:00
liblvm/Makefile
2009-07-23 01:09:13 +04:00
liblvm/liblvm2app.pc
2008-11-01 01:06:09 +03:00
man/Makefile
po/Makefile
2012-10-12 05:08:47 +04:00
python/Makefile
python/setup.py
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/clvmd_init_red_hat
scripts/cmirrord_init_red_hat
scripts/dm_event_systemd_red_hat.service
scripts/dm_event_systemd_red_hat.socket
2014-02-10 20:05:10 +04:00
scripts/lvm2_cluster_activation_red_hat.sh
2014-02-11 13:03:19 +04:00
scripts/lvm2_cluster_activation_systemd_red_hat.service
scripts/lvm2_clvmd_systemd_red_hat.service
2014-02-11 12:55:57 +04:00
scripts/lvm2_cmirrord_systemd_red_hat.service
2012-02-24 17:03:50 +04:00
scripts/lvm2_lvmetad_init_red_hat
2012-02-23 15:24:07 +04:00
scripts/lvm2_lvmetad_systemd_red_hat.service
2014-04-29 14:44:32 +04:00
scripts/lvm2_lvmetad_systemd_red_hat.socket
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
2014-04-29 14:44:32 +04:00
scripts/lvm2_pvscan_systemd_red_hat@.service
2012-02-22 21:55:10 +04:00
scripts/lvm2_tmpfiles_red_hat.conf
2007-09-18 22:26:32 +04:00
scripts/Makefile
2008-11-01 01:06:09 +03:00
test/Makefile
2008-12-07 22:37:07 +03:00
test/api/Makefile
2011-11-21 01:43:20 +04:00
test/unit/Makefile
2007-09-18 22:26:32 +04:00
tools/Makefile
2009-07-31 15:49:53 +04:00
udev/Makefile
2010-07-20 19:25:39 +04:00
unit-tests/datastruct/Makefile
2010-07-20 19:21:32 +04:00
unit-tests/regex/Makefile
2010-08-09 14:56:01 +04:00
unit-tests/mm/Makefile
2007-08-14 23:11:31 +04:00
])
AC_OUTPUT
2003-11-06 20:14:06 +03:00
2013-12-12 16:07:59 +04:00
test -n "$THIN_CONFIGURE_WARN" && AC_MSG_WARN([Support for thin provisioning is limited since some thin provisioning tools are missing!])
2014-06-05 19:28:03 +04:00
test -n "$THIN_CHECK_VERSION_WARN" && AC_MSG_WARN([You should also install thin_check vsn 0.3.2 (or later) to use lvm2 thin provisioning])
2014-04-07 19:44:29 +04:00
2014-07-04 18:31:29 +04:00
test -n "$CACHE_CONFIGURE_WARN" && AC_MSG_WARN([Support for cache is limited since some cache tools are missing!])
2014-06-05 20:02:40 +04:00
test "$ODIRECT" = yes || AC_MSG_WARN([O_DIRECT disabled: low-memory pvmove may lock up])