###############################################################################
## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
-## Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
CFLAGS="$CFLAGS"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ ELDFLAGS="-Wl,--export-dynamic"
+ # FIXME Generate list and use --dynamic-list=.dlopen.sym
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LDDEPS="$LDDEPS .export.sym"
- LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
LIB_SUFFIX=so
DEVMAPPER=yes
+ LVMETAD=no
ODIRECT=yes
DM_IOCTLS=yes
SELINUX=yes
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS"
+ ELDFLAGS=
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
LIB_SUFFIX=dylib
################################################################################
dnl -- Check for functions
-AC_SEARCH_LIBS([floor], [m], , [AC_MSG_ERROR(bailing out)])
-AC_CHECK_FUNCS([floor ftruncate gethostname getpagesize \
+AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600)
AC_MSG_RESULT($DM_DEVICE_MODE)
+AC_MSG_CHECKING(when to create device nodes)
+AC_ARG_WITH(device-nodes-on,
+ AC_HELP_STRING([--with-device-nodes-on=ON],
+ [create nodes on resume or create [[ON=resume]]]),
+ ADD_NODE=$withval, ADD_NODE=resume)
+case "$ADD_NODE" in
+ resume) add_on=DM_ADD_NODE_ON_RESUME;;
+ create) add_on=DM_ADD_NODE_ON_CREATE;;
+ *) AC_MSG_ERROR([--with-device-nodes-on parameter invalid]);;
+esac
+AC_MSG_RESULT(on $ADD_NODE)
+AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
+
+AC_MSG_CHECKING(default name mangling)
+AC_ARG_WITH(default-name-mangling,
+ AC_HELP_STRING([--with-default-name-mangling=MANGLING],
+ [default name mangling: auto/none/hex [[MANGLING=auto]]]),
+ MANGLING=$withval, MANGLING=auto)
+case "$MANGLING" in
+ auto) mangling=DM_STRING_MANGLING_AUTO;;
+ disabled) mangling=DM_STRING_MANGLING_NONE;;
+ hex) mangling=DM_STRING_MANGLING_HEX;;
+ *) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
+esac
+AC_MSG_RESULT($MANGLING)
+AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
+
################################################################################
dnl -- LVM1 tool fallback option
AC_MSG_CHECKING(whether to enable lvm1 fallback)
AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
fi
+################################################################################
+dnl -- raid inclusion type
+AC_MSG_CHECKING(whether to include raid)
+AC_ARG_WITH(raid,
+ AC_HELP_STRING([--with-raid=TYPE],
+ [mirror support: internal/shared/none
+ [[TYPE=internal]]]),
+ RAID=$withval, RAID=internal)
+AC_MSG_RESULT($RAID)
+
+if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]];
+ then AC_MSG_ERROR(
+--with-raid parameter invalid
+)
+fi;
+
+if test x$RAID = xinternal; then
+ AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.])
+fi
+
################################################################################
dnl -- asynchronous volume replicator inclusion type
AC_MSG_CHECKING(whether to include replicators)
*) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
esac
+################################################################################
+dnl -- thin provisioning
+AC_MSG_CHECKING(whether to include thin provisioning)
+AC_ARG_WITH(thin,
+ AC_HELP_STRING([--with-thin=TYPE],
+ [thin provisioning support: internal/shared/none
+ [[TYPE=none]]]),
+ THIN=$withval, THIN=none)
+AC_MSG_RESULT($THIN)
+
+case "$THIN" in
+ none|shared) ;;
+ internal) AC_DEFINE([THIN_INTERNAL], 1,
+ [Define to 1 to include built-in support for thin provisioning.]) ;;
+ *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
+esac
+
+case "$THIN" in
+ internal|shared)
+ AC_ARG_WITH(thin-check,
+ AC_HELP_STRING([--with-thin-check=PATH],
+ [thin_check tool: [[autodetect]]]),
+ THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
+ # Empty means a config way to ignore thin checking
+ if test "$THIN_CHECK_CMD" = "autodetect"; then
+ AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
+ test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
+ fi
+ ;;
+esac
+
+AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
+ [The path to 'thin_check', if available.])
+
+
################################################################################
dnl -- Disable readline
AC_MSG_CHECKING(whether to enable readline)
REALTIME=$enableval)
AC_MSG_RESULT($REALTIME)
+################################################################################
+dnl -- disable OCF resource agents
+AC_MSG_CHECKING(whether to enable OCF resource agents)
+AC_ARG_ENABLE(ocf,
+ AC_HELP_STRING([--enable-ocf],
+ [enable Open Cluster Framework (OCF) compliant resource agents]),
+ OCF=$enableval, OCF=no)
+AC_MSG_RESULT($OCF)
+AC_ARG_WITH(ocfdir,
+ AC_HELP_STRING([--with-ocfdir=DIR],
+ [install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
+ OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
+
################################################################################
dnl -- Init pkg-config with dummy invokation:
dnl -- this is required because PKG_CHECK_MODULES macro is expanded
PKGCONFIG_INIT=1
}
+################################################################################
+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.])
+
################################################################################
dnl -- Build cluster LVM daemon
AC_MSG_CHECKING(whether to build cluster LVM daemon)
AC_ARG_WITH(clvmd,
[ --with-clvmd=TYPE build cluster LVM Daemon
The following cluster manager combinations are valid:
- * cman,gulm (RHEL4 or equivalent)
* cman (RHEL5 or equivalent)
* cman,corosync,openais (or selection of them)
* singlenode (localhost only)
fi
dnl -- init pkgconfig if required
-if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
+if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
+dnl -- Express clvmd init script Required-Start / Required-Stop
+CLVMD_CMANAGERS=""
+dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
+dnl -- Enable if we are build for cman.
+CLVMD_NEEDS_QDISKD=no
dnl -- define build types
if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
- BUILDGULM=yes
+ AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]);
+fi
+if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
+ BUILDCMAN=yes
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
+ CLVMD_NEEDS_QDISKD=yes
fi
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
BUILDCOROSYNC=yes
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
fi
if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
BUILDOPENAIS=yes
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
fi
-if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
- BUILDCMAN=yes
-fi
-
-dnl -- sanity check around user selection
-if test x$BUILDGULM = xyes; then
- if test x$BUILDCOROSYNC = xyes || \
- test x$BUILDOPENAIS = xyes; then
- AC_MSG_ERROR([requested clvmd configuration is not valid])
- fi
+if test x$CLVMD_NEEDS_QDISKD != xno; then
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
fi
dnl -- define a soft bailout if we are autodetecting
dnl -- if clvmd=all then set soft_bailout (we don't want to error)
dnl -- and set all builds to yes. We need to do this here
-dnl -- to skip the gulm + openais|corosync sanity check above.
+dnl -- to skip the openais|corosync sanity check above.
if test x$CLVMD = xall; then
bailout=soft_bailout
- BUILDGULM=yes
BUILDCMAN=yes
BUILDCOROSYNC=yes
BUILDOPENAIS=yes
LIBS=$ac_check_lib_save_LIBS
}
-dnl -- Look for gulm libraries if required.
-if test x$BUILDGULM = xyes; then
- PKG_CHECK_MODULES(CCS, libccs, [HAVE_CCS=yes],
- [NOTFOUND=0
- AC_CHECK_HEADERS(ccs.h,,$bailout)
- check_lib_no_libs ccs ccs_connect
- if test $NOTFOUND = 0; then
- AC_MSG_RESULT([no pkg for libccs, using -lccs])
- CCS_LIBS="-lccs"
- HAVE_CCS=yes
- fi])
- PKG_CHECK_MODULES(GULM, libgulm, [HAVE_GULM=yes],
- [NOTFOUND=0
- AC_CHECK_HEADERS(libgulm.h,,$bailout)
- check_lib_no_libs gulm lg_core_login
- if test $NOTFOUND = 0; then
- AC_MSG_RESULT([no pkg for libgulm, using -lgulm])
- GULM_LIBS="-lgulm"
- HAVE_GULM=yes
- fi])
-fi
-
dnl -- Look for cman libraries if required.
if test x$BUILDCMAN = xyes; then
PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
test x$BUILDOPENAIS = xyes; then
PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
CHECKCONFDB=yes
+ CHECKCMAP=yes
fi
dnl -- Look for corosync libraries if required.
dnl -- Below are checks for libraries common to more than one build.
dnl -- Check confdb library.
-dnl -- mandatory for corosync build.
+dnl -- mandatory for corosync < 2.0 build.
dnl -- optional for openais/cman build.
if test x$CHECKCONFDB = xyes; then
CONFDB_LIBS="-lconfdb"
HAVE_CONFDB=yes
fi
+fi
+
+dnl -- Check cmap library
+dnl -- mandatory for corosync >= 2.0 build.
- if test x$BUILDCOROSYNC = xyes && \
- test x$HAVE_CONFDB != xyes &&
+if test x$CHECKCMAP = xyes; then
+ PKG_CHECK_MODULES(CMAP, libcmap,
+ [HAVE_CMAP=yes],
+ [HAVE_CMAP=no])
+
+ AC_CHECK_HEADERS(corosync/cmap.h,
+ [HAVE_CMAP_H=yes],
+ [HAVE_CMAP_H=no])
+
+ if test x$HAVE_CMAP != xyes && \
+ test x$HAVE_CMAP_H = xyes; then
+ check_lib_no_libs cmap cmap_initialize
+ AC_MSG_RESULT([no pkg for cmap, using -lcmap])
+ CMAP_LIBS="-lcmap"
+ HAVE_CMAP=yes
+ fi
+fi
+
+if test x$BUILDCOROSYNC = xyes; then
+ if test x$HAVE_CMAP != xyes && \
+ test x$HAVE_CONFDB != xyes && \
test x$CLVMD != xall; then
- AC_MSG_ERROR([bailing out... confdb library is required])
+ AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
fi
fi
fi
dnl -- If we are autodetecting, we need to re-create
-dnl -- the depedencies checks and set a proper CLVMD.
+dnl -- the depedencies checks and set a proper CLVMD,
+dnl -- together with init script Required-Start/Stop entries.
if test x$CLVMD = xall; then
CLVMD=none
- if test x$HAVE_CCS = xyes && \
- test x$HAVE_GULM = xyes; then
- AC_MSG_RESULT([Enabling clvmd gulm cluster manager])
- CLVMD="$CLVMD,gulm"
- fi
+ CLVMD_CMANAGERS=""
+ CLVMD_NEEDS_QDISKD=no
if test x$HAVE_CMAN = xyes && \
test x$HAVE_DLM = xyes; then
AC_MSG_RESULT([Enabling clvmd cman cluster manager])
CLVMD="$CLVMD,cman"
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
+ CLVMD_NEEDS_QDISKD=yes
fi
if test x$HAVE_COROSYNC = xyes && \
test x$HAVE_QUORUM = xyes && \
test x$HAVE_CPG = xyes && \
- test x$HAVE_DLM = xyes && \
- test x$HAVE_CONFDB = xyes; then
+ test x$HAVE_DLM = xyes; then
+ if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then
AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
CLVMD="$CLVMD,corosync"
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
+ fi
fi
if test x$HAVE_COROSYNC = xyes && \
test x$HAVE_CPG = xyes && \
test x$HAVE_SALCK = xyes; then
AC_MSG_RESULT([Enabling clvmd openais cluster manager])
CLVMD="$CLVMD,openais"
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
+ fi
+ if test x$CLVMD_NEEDS_QDISKD != xno; then
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
fi
if test x$CLVMD = xnone; then
AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
fi
fi
+dnl -- Fixup CLVMD_CMANAGERS with new corosync
+dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
+dnl -- to be started.
+if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
+ if test x$HAVE_CMAP = xyes; then
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
+ fi
+fi
+
+################################################################################
+dnl -- clvmd pidfile
+if test "x$CLVMD" != xnone; then
+ AC_ARG_WITH(clvmd-pidfile,
+ AC_HELP_STRING([--with-clvmd-pidfile=PATH],
+ [clvmd pidfile [[PID_DIR/clvmd.pid]]]),
+ CLVMD_PIDFILE=$withval,
+ CLVMD_PIDFILE="$DEFAULT_PID_DIR/clvmd.pid")
+ AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
+ [Path to clvmd pidfile.])
+fi
+
################################################################################
dnl -- Build cluster mirror log daemon
AC_MSG_CHECKING(whether to build cluster mirror log daemon)
if test "x$BUILD_CMIRRORD" = xyes; then
AC_ARG_WITH(cmirrord-pidfile,
AC_HELP_STRING([--with-cmirrord-pidfile=PATH],
- [cmirrord pidfile [[/var/run/cmirrord.pid]]]),
+ [cmirrord pidfile [[PID_DIR/cmirrord.pid]]]),
CMIRRORD_PIDFILE=$withval,
- CMIRRORD_PIDFILE="/var/run/cmirrord.pid")
+ CMIRRORD_PIDFILE="$DEFAULT_PID_DIR/cmirrord.pid")
AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"],
[Path to cmirrord pidfile.])
fi
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
- PKG_CHECK_MODULES(SACKPT, libSaCkpt)
+
+ AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
+ PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
+ [AC_MSG_RESULT([no libSaCkpt, compiling without it])
+ AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
+
if test x$HAVE_CPG != xyes; then
PKG_CHECK_MODULES(CPG, libcpg)
fi
fi
fi
+################################################################################
+dnl -- Enable testing
+AC_MSG_CHECKING(whether to enable unit testing)
+AC_ARG_ENABLE(testing,
+ AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]),
+ TESTING=$enableval, TESTING=no)
+AC_MSG_RESULT($TESTING)
+
+if test "$TESTING" = yes; then
+ PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
+fi
+
+################################################################################
+dnl -- Enable valgrind awareness of memory pools
+AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
+AC_ARG_ENABLE(valgrind_pool,
+ AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]),
+ VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
+AC_MSG_RESULT($VALGRIND_POOL)
+
+if test "$VALGRIND_POOL" = yes; then
+ AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)])
+ AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
+fi
+
################################################################################
dnl -- Disable devmapper
AC_MSG_CHECKING(whether to use device-mapper)
AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
fi
+################################################################################
+dnl -- Build lvmetad
+AC_MSG_CHECKING(whether to build LVMetaD)
+AC_ARG_ENABLE(lvmetad,
+ AC_HELP_STRING([--enable-lvmetad],
+ [enable the LVM Metadata Daemon]),
+ LVMETAD=$enableval)
+AC_MSG_RESULT($LVMETAD)
+
+BUILD_LVMETAD=$LVMETAD
+
+if test x$BUILD_LVMETAD = xyes; then
+ AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
+
+ 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.])
+fi
+
################################################################################
dnl -- Enable udev synchronisation
AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
AC_MSG_RESULT($UDEV_SYNC)
if test x$UDEV_SYNC = xyes; then
- AC_CHECK_LIB(udev, udev_queue_get_udev_is_active,
- [UDEV_PC="libudev"; UDEV_LIBS="-ludev"],
- [AC_MSG_ERROR([bailing out... libudev library is required])])
+ dnl -- init pkgconfig if required
+ if test x$PKGCONFIG_INIT != x1; then
+ pkg_config_init
+ fi
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
fi
UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
AC_MSG_RESULT($UDEV_RULES)
+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
+AC_MSG_CHECKING(whether udev supports built-in blkid)
+test x$PKGCONFIG_INIT != x1 && 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)
+
################################################################################
dnl -- Compatibility mode
AC_ARG_ENABLE(compat,
[enable support for old device-mapper versions]),
DM_COMPAT=$enableval, DM_COMPAT=no)
+if test x$DM_COMPAT = xyes; then
+ AC_MSG_ERROR(
+ [--enable-compat is not currently supported.
+Since device-mapper version 1.02.66, only one version (4) of the device-mapper
+ioctl protocol is supported.]
+ )
+fi
+
################################################################################
dnl -- Compatible units suffix mode
AC_ARG_ENABLE(units-compat,
dnl -- Check for shared/static conflicts
if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
-o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
+ -o "x$RAID" = xshared \
\) -a "x$STATIC_LINK" = xyes ]];
then AC_MSG_ERROR(
Features cannot be 'shared' when building statically
AC_CHECK_LIB([selinux], [is_selinux_enabled], [
AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ AC_CHECK_HEADERS([selinux/label.h])
AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
SELINUX_LIBS="-lselinux $SELINUX_LIBS"
SELINUX_PC="libselinux"
udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
################################################################################
+dnl -- Get the systemd system unit dir value from pkg_config automatically if value not given explicitly.
+dnl -- This follows the recommendation for systemd integration best practices mentioned in daemon(7) manpage.
+AC_ARG_WITH(systemdsystemunitdir,
+ AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
+ [systemd service files in DIR]),
+ systemdsystemunitdir=$withval,
+ dnl -- init pkgconfig if required
+ test x$PKGCONFIG_INIT != x1 && pkg_config_init
+ pkg_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd))
+
+if test -n "$pkg_systemdsystemunitdir"; then
+ systemdsystemunitdir=$pkg_systemdsystemunitdir;
+fi
+
+if test -z "$systemdsystemunitdir"; then
+ systemdsystemunitdir='/lib/systemd/system';
+fi
+################################################################################
+AC_ARG_WITH(tmpfilesdir,
+ AC_HELP_STRING([--with-tmpfilesdir=DIR],
+ [install configuration files for management of volatile files and directories in DIR [[PREFIX/lib/tmpfiles.d]]]),
+ tmpfilesdir=$withval, tmpfilesdir='${prefix}/lib/tmpfiles.d')
+################################################################################
dnl -- Ensure additional headers required
if test x$READLINE = xyes; then
AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
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
-AC_DEFINE_UNQUOTED(LVM_PATH, ["$lvm_exec_prefix/sbin/lvm"], [Path to lvm binary.])
+LVM_PATH="$lvm_exec_prefix/sbin/lvm"
+AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
if test "$CLVMD" != none; then
clvmd_prefix=$ac_default_prefix
+ CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
test "$prefix" != NONE && clvmd_prefix=$prefix
- AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$clvmd_prefix/sbin/clvmd"],
- [Path to clvmd binary.])
+ AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
fi
################################################################################
if test "$BUILD_DMEVENTD" = yes; then
AC_ARG_WITH(dmeventd-pidfile,
AC_HELP_STRING([--with-dmeventd-pidfile=PATH],
- [dmeventd pidfile [[/var/run/dmeventd.pid]]]),
+ [dmeventd pidfile [[PID_DIR/dmeventd.pid]]]),
DMEVENTD_PIDFILE=$withval,
- DMEVENTD_PIDFILE="/var/run/dmeventd.pid")
+ DMEVENTD_PIDFILE="$DEFAULT_PID_DIR/dmeventd.pid")
AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
[Path to dmeventd pidfile.])
fi
AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
[Name of default locking directory.])
+################################################################################
+dnl -- Setup default data alignment
+AC_ARG_WITH(default-data-alignment,
+ AC_HELP_STRING([--with-default-data-alignment=NUM],
+ [set the default data alignment in MiB [[1]]]),
+ DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1)
+AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT],
+ [Default data alignment.])
+
################################################################################
dnl -- which kernel interface to use (ioctl only)
AC_MSG_CHECKING(for kernel interface choice)
AC_SUBST(AWK)
AC_SUBST(BUILD_CMIRRORD)
AC_SUBST(BUILD_DMEVENTD)
-AC_SUBST(CCS_CFLAGS)
-AC_SUBST(CCS_LIBS)
+AC_SUBST(BUILD_LVMETAD)
AC_SUBST(CFLAGS)
AC_SUBST(CFLOW_CMD)
AC_SUBST(CLDFLAGS)
AC_SUBST(CLDWHOLEARCHIVE)
AC_SUBST(CLUSTER)
AC_SUBST(CLVMD)
+AC_SUBST(CLVMD_CMANAGERS)
+AC_SUBST(CLVMD_PATH)
AC_SUBST(CMAN_CFLAGS)
AC_SUBST(CMAN_LIBS)
+AC_SUBST(CMAP_CFLAGS)
+AC_SUBST(CMAP_LIBS)
AC_SUBST(CMDLIB)
AC_SUBST(CONFDB_CFLAGS)
AC_SUBST(CONFDB_LIBS)
AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
AC_SUBST(DEFAULT_BACKUP_SUBDIR)
AC_SUBST(DEFAULT_CACHE_SUBDIR)
+AC_SUBST(DEFAULT_DATA_ALIGNMENT)
AC_SUBST(DEFAULT_LOCK_DIR)
+AC_SUBST(DEFAULT_DM_RUN_DIR)
+AC_SUBST(DEFAULT_RUN_DIR)
AC_SUBST(DEVMAPPER)
AC_SUBST(DLM_CFLAGS)
AC_SUBST(DLM_LIBS)
AC_SUBST(DL_LIBS)
AC_SUBST(DMEVENTD)
+AC_SUBST(DMEVENTD_PATH)
AC_SUBST(DM_COMPAT)
AC_SUBST(DM_DEVICE_GID)
AC_SUBST(DM_DEVICE_MODE)
AC_SUBST(DM_IOCTLS)
AC_SUBST(DM_LIB_VERSION)
AC_SUBST(DM_LIB_PATCHLEVEL)
+AC_SUBST(ELDFLAGS)
AC_SUBST(FSADM)
-AC_SUBST(GULM_CFLAGS)
-AC_SUBST(GULM_LIBS)
AC_SUBST(HAVE_LIBDL)
AC_SUBST(HAVE_REALTIME)
AC_SUBST(INTL)
AC_SUBST(LVM_MAJOR)
AC_SUBST(LVM_MINOR)
AC_SUBST(LVM_PATCHLEVEL)
+AC_SUBST(LVM_PATH)
AC_SUBST(LVM_RELEASE)
AC_SUBST(LVM_RELEASE_DATE)
AC_SUBST(MIRRORS)
-AC_SUBST(REPLICATORS)
AC_SUBST(MSGFMT)
+AC_SUBST(OCF)
+AC_SUBST(OCFDIR)
AC_SUBST(PKGCONFIG)
AC_SUBST(POOL)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(QUORUM_CFLAGS)
AC_SUBST(QUORUM_LIBS)
+AC_SUBST(RAID)
AC_SUBST(READLINE_LIBS)
+AC_SUBST(REPLICATORS)
AC_SUBST(SACKPT_CFLAGS)
AC_SUBST(SACKPT_LIBS)
AC_SUBST(SALCK_CFLAGS)
AC_SUBST(SNAPSHOTS)
AC_SUBST(STATICDIR)
AC_SUBST(STATIC_LINK)
+AC_SUBST(TESTING)
+AC_SUBST(THIN)
+AC_SUBST(THIN_CHECK_CMD)
AC_SUBST(UDEV_LIBS)
AC_SUBST(UDEV_PC)
AC_SUBST(UDEV_RULES)
AC_SUBST(UDEV_SYNC)
+AC_SUBST(UDEV_RULE_EXEC_DETECTION)
+AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
+AC_SUBST(CUNIT_LIBS)
+AC_SUBST(CUNIT_CFLAGS)
AC_SUBST(WRITE_INSTALL)
+AC_SUBST(DMEVENTD_PIDFILE)
+AC_SUBST(LVMETAD_PIDFILE)
AC_SUBST(interface)
AC_SUBST(kerneldir)
AC_SUBST(missingkernel)
AC_SUBST(tmpdir)
AC_SUBST(udev_prefix)
AC_SUBST(udevdir)
+AC_SUBST(systemdsystemunitdir)
+AC_SUBST(tmpfilesdir)
AC_SUBST(usrlibdir)
AC_SUBST(usrsbindir)
daemons/dmeventd/libdevmapper-event.pc
daemons/dmeventd/plugins/Makefile
daemons/dmeventd/plugins/lvm2/Makefile
+daemons/dmeventd/plugins/raid/Makefile
daemons/dmeventd/plugins/mirror/Makefile
daemons/dmeventd/plugins/snapshot/Makefile
+daemons/dmeventd/plugins/thin/Makefile
+daemons/lvmetad/Makefile
doc/Makefile
doc/example.conf
include/.symlinks
lib/mirror/Makefile
lib/replicator/Makefile
lib/misc/lvm-version.h
+lib/raid/Makefile
lib/snapshot/Makefile
+lib/thin/Makefile
+libdaemon/Makefile
+libdaemon/client/Makefile
+libdaemon/server/Makefile
libdm/Makefile
libdm/libdevmapper.pc
liblvm/Makefile
po/Makefile
scripts/clvmd_init_red_hat
scripts/cmirrord_init_red_hat
+scripts/lvm2_lvmetad_init_red_hat
+scripts/lvm2_lvmetad_systemd_red_hat.socket
+scripts/lvm2_lvmetad_systemd_red_hat.service
scripts/lvm2_monitoring_init_red_hat
+scripts/dm_event_systemd_red_hat.socket
+scripts/dm_event_systemd_red_hat.service
+scripts/lvm2_monitoring_systemd_red_hat.service
+scripts/lvm2_tmpfiles_red_hat.conf
scripts/Makefile
test/Makefile
test/api/Makefile
+test/unit/Makefile
tools/Makefile
udev/Makefile
+unit-tests/datastruct/Makefile
+unit-tests/regex/Makefile
+unit-tests/mm/Makefile
])
AC_OUTPUT