###############################################################################
## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
-## Copyright (C) 2004-2011 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
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_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)
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)
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$CHECKCMAP = xyes; then
+ PKG_CHECK_MODULES(CMAP, libcmap,
+ [HAVE_CMAP=yes],
+ [HAVE_CMAP=no])
+
+ AC_CHECK_HEADERS(corosync/cmap.h,
+ [HAVE_CMAP_H=yes],
+ [HAVE_CMAP_H=no])
+
+ if test x$HAVE_CMAP != xyes && \
+ test x$HAVE_CMAP_H = xyes; then
+ check_lib_no_libs cmap cmap_initialize
+ AC_MSG_RESULT([no pkg for cmap, using -lcmap])
+ CMAP_LIBS="-lcmap"
+ HAVE_CMAP=yes
+ fi
+fi
- if test x$BUILDCOROSYNC = xyes && \
- test x$HAVE_CONFDB != xyes &&
+if test x$BUILDCOROSYNC = xyes; then
+ if test x$HAVE_CMAP != xyes && \
+ test x$HAVE_CONFDB != xyes && \
test x$CLVMD != xall; then
- AC_MSG_ERROR([bailing out... confdb library is required])
+ AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
fi
fi
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 && \
fi
fi
+dnl -- Fixup CLVMD_CMANAGERS with new corosync
+dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
+dnl -- to be started.
+if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
+ if test x$HAVE_CMAP = xyes; then
+ CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
+ fi
+fi
+
################################################################################
dnl -- clvmd pidfile
if test "x$CLVMD" != xnone; then
AC_ARG_WITH(clvmd-pidfile,
AC_HELP_STRING([--with-clvmd-pidfile=PATH],
- [clvmd pidfile [[/var/run/clvmd.pid]]]),
+ [clvmd pidfile [[PID_DIR/clvmd.pid]]]),
CLVMD_PIDFILE=$withval,
- CLVMD_PIDFILE="/var/run/clvmd.pid")
+ CLVMD_PIDFILE="$DEFAULT_PID_DIR/clvmd.pid")
AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"],
[Path to clvmd pidfile.])
fi
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
AC_MSG_RESULT($TESTING)
if test "$TESTING" = yes; then
- AC_PATH_PROG(RUBY19, ruby1.9)
- AC_PATH_PROG(VALGRIND, valgrind)
- if test -z "$RUBY19" -o -z "$VALGRIND"; then
- AC_MSG_ERROR([ruby1.9 and valgrind are required for testing])
- fi
+ PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
fi
################################################################################
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)
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,
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
[Path to dmeventd binary.])
fi
-AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.])
-AC_ARG_WITH(default-run-dir,
- [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ],
- [ DEFAULT_RUN_DIR="$withval" ],
- [ DEFAULT_RUN_DIR="/var/run/lvm" ])
-AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] )
-
################################################################################
dnl -- various defaults
AC_ARG_WITH(default-system-dir,
AC_SUBST(AWK)
AC_SUBST(BUILD_CMIRRORD)
AC_SUBST(BUILD_DMEVENTD)
+AC_SUBST(BUILD_LVMETAD)
AC_SUBST(CFLAGS)
AC_SUBST(CFLOW_CMD)
AC_SUBST(CLDFLAGS)
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_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(DM_IOCTLS)
AC_SUBST(DM_LIB_VERSION)
AC_SUBST(DM_LIB_PATCHLEVEL)
+AC_SUBST(ELDFLAGS)
AC_SUBST(FSADM)
AC_SUBST(HAVE_LIBDL)
AC_SUBST(HAVE_REALTIME)
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(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/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/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