1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-09 13:57:55 +03:00
lvm2/configure.in

1686 lines
55 KiB
Plaintext
Raw Normal View History

###############################################################################
2004-07-03 18:21:13 +00:00
## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
## Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
2001-09-21 12:37:43 +00:00
##
2004-07-03 18:21:13 +00: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 12:37:43 +00:00
##
2004-07-03 18:21:13 +00: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 12:37:43 +00:00
################################################################################
AC_PREREQ(2.61)
################################################################################
dnl -- Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
AC_CONFIG_HEADERS([lib/misc/configure.h])
################################################################################
2004-07-03 18:21:13 +00:00
dnl -- Setup the directory where autoconf has auxilary files
AC_CONFIG_AUX_DIR(autoconf)
2001-09-21 12:37:43 +00:00
################################################################################
dnl -- Get system type
AC_CANONICAL_TARGET([])
2003-04-15 13:24:42 +00:00
case "$host_os" in
linux*)
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
2004-03-26 14:17:14 +00:00
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LDDEPS="$LDDEPS .export.sym"
LIB_SUFFIX=so
2004-03-26 14:17:14 +00:00
DEVMAPPER=yes
LVMETAD=no
ODIRECT=yes
DM_IOCTLS=yes
SELINUX=yes
2004-06-24 08:02:38 +00:00
CLUSTER=internal
2008-10-31 22:06:09 +00:00
FSADM=yes
BLKDEACTIVATE=yes
;;
2004-03-26 14:17:14 +00:00
darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
COPTIMISE_FLAG="-O2"
CLDFLAGS="$CLDFLAGS"
ELDFLAGS=
2004-03-26 14:17:14 +00:00
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
LIB_SUFFIX=dylib
DEVMAPPER=yes
ODIRECT=no
DM_IOCTLS=no
SELINUX=no
2004-06-24 08:02:38 +00:00
CLUSTER=none
FSADM=no
BLKDEACTIVATE=no
;;
2003-04-15 13:24:42 +00:00
esac
################################################################################
dnl -- Checks for programs.
AC_PROG_SED
AC_PROG_AWK
AC_PROG_CC
dnl probably no longer needed in 2008, but...
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
2008-06-27 19:24:17 +00:00
AC_PROG_RANLIB
AC_PATH_PROG(CFLOW_CMD, cflow)
AC_PATH_PROG(CSCOPE_CMD, cscope)
################################################################################
dnl -- Check for header files.
AC_HEADER_DIRENT
AC_HEADER_MAJOR
AC_HEADER_STDC
2004-07-03 18:21:13 +00:00
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
sys/wait.h time.h], ,
[AC_MSG_ERROR(bailing out)])
2004-07-03 18:21:13 +00: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
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)
################################################################################
dnl -- Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
2004-07-03 18:21:13 +00:00
AC_TYPE_MODE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_CHECK_MEMBERS([struct stat.st_rdev])
2004-07-03 18:21:13 +00:00
AC_STRUCT_TM
################################################################################
dnl -- Check for functions
AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
AC_CHECK_FUNCS(siginterrupt)
2004-07-03 18:21:13 +00:00
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_CHOWN
2004-07-03 18:21:13 +00:00
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_REALLOC
2004-07-03 18:21:13 +00:00
AC_FUNC_STAT
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
################################################################################
dnl -- Enables statically-linked tools
AC_MSG_CHECKING(whether to use static linking)
AC_ARG_ENABLE(static_link,
AC_HELP_STRING([--enable-static_link],
[use this to link the tools to their libraries
statically (default is dynamic linking]),
STATIC_LINK=$enableval, STATIC_LINK=no)
AC_MSG_RESULT($STATIC_LINK)
################################################################################
dnl -- Prefix is /usr by default, the exec_prefix default is setup later
2001-09-21 12:37:43 +00:00
AC_PREFIX_DEFAULT(/usr)
################################################################################
dnl -- Setup the ownership of the files
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(file owner)
2001-09-21 12:37:43 +00:00
AC_ARG_WITH(user,
AC_HELP_STRING([--with-user=USER],
[set the owner of installed files [[USER=]]]),
OWNER=$withval)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($OWNER)
if test x$OWNER != x; then
INSTALL="$INSTALL -o $OWNER"
fi
2001-09-21 12:37:43 +00:00
################################################################################
dnl -- Setup the group ownership of the files
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(group owner)
2001-09-21 12:37:43 +00:00
AC_ARG_WITH(group,
AC_HELP_STRING([--with-group=GROUP],
[set the group owner of installed files [[GROUP=]]]),
GROUP=$withval)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($GROUP)
if test x$GROUP != x; then
INSTALL="$INSTALL -g $GROUP"
fi
2001-09-21 12:37:43 +00:00
2008-11-01 02:19:19 +00:00
################################################################################
dnl -- Setup device node ownership
AC_MSG_CHECKING(device node uid)
AC_ARG_WITH(device-uid,
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 02:19:19 +00:00
AC_MSG_RESULT($DM_DEVICE_UID)
################################################################################
dnl -- Setup device group ownership
AC_MSG_CHECKING(device node gid)
AC_ARG_WITH(device-gid,
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 02:19:19 +00:00
AC_MSG_RESULT($DM_DEVICE_GID)
2008-10-31 22:06:09 +00:00
################################################################################
dnl -- Setup device mode
AC_MSG_CHECKING(device node mode)
AC_ARG_WITH(device-mode,
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-10-31 22:06:09 +00:00
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
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to enable lvm1 fallback)
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 18:21:13 +00:00
AC_MSG_RESULT($LVM1_FALLBACK)
if test x$LVM1_FALLBACK = xyes; then
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])
fi
################################################################################
2002-11-18 14:04:08 +00:00
dnl -- format1 inclusion type
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to include support for lvm1 metadata)
2002-11-18 14:04:08 +00:00
AC_ARG_WITH(lvm1,
AC_HELP_STRING([--with-lvm1=TYPE],
[LVM1 metadata support: internal/shared/none
[[TYPE=internal]]]),
LVM1=$withval, LVM1=internal)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($LVM1)
2002-11-18 14:04:08 +00:00
if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
then AC_MSG_ERROR(
--with-lvm1 parameter invalid
)
fi;
2003-04-15 13:24:42 +00:00
if test x$LVM1 = xinternal; then
AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
2003-04-15 13:24:42 +00:00
fi
################################################################################
2004-06-07 19:10:21 +00:00
dnl -- format_pool inclusion type
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to include support for GFS pool metadata)
2004-06-07 19:10:21 +00:00
AC_ARG_WITH(pool,
AC_HELP_STRING([--with-pool=TYPE],
[GFS pool read-only support: internal/shared/none
[[TYPE=internal]]]),
POOL=$withval, POOL=internal)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($POOL)
2004-06-07 19:10:21 +00:00
if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
then AC_MSG_ERROR(
--with-pool parameter invalid
)
fi;
if test x$POOL = xinternal; then
AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
2004-06-07 19:10:21 +00:00
fi
################################################################################
2004-06-24 08:02:38 +00:00
dnl -- cluster_locking inclusion type
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to include support for cluster locking)
2004-06-24 08:02:38 +00:00
AC_ARG_WITH(cluster,
AC_HELP_STRING([--with-cluster=TYPE],
[cluster LVM locking support: internal/shared/none
[[TYPE=internal]]]),
CLUSTER=$withval)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($CLUSTER)
2004-06-24 08:02:38 +00:00
if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
then AC_MSG_ERROR(
--with-cluster parameter invalid
)
fi;
if test x$CLUSTER = xinternal; then
AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
2004-06-24 08:02:38 +00:00
fi
2004-06-07 19:10:21 +00:00
################################################################################
2004-05-04 21:25:57 +00:00
dnl -- snapshots inclusion type
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to include snapshots)
2004-05-04 21:25:57 +00:00
AC_ARG_WITH(snapshots,
AC_HELP_STRING([--with-snapshots=TYPE],
[snapshot support: internal/shared/none
[[TYPE=internal]]]),
SNAPSHOTS=$withval, SNAPSHOTS=internal)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($SNAPSHOTS)
2004-05-04 21:25:57 +00:00
if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
then AC_MSG_ERROR(
--with-snapshots parameter invalid
)
fi;
if test x$SNAPSHOTS = xinternal; then
AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
2004-05-04 21:25:57 +00:00
fi
################################################################################
2004-05-04 21:25:57 +00:00
dnl -- mirrors inclusion type
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to include mirrors)
2004-05-04 21:25:57 +00:00
AC_ARG_WITH(mirrors,
AC_HELP_STRING([--with-mirrors=TYPE],
[mirror support: internal/shared/none
[[TYPE=internal]]]),
MIRRORS=$withval, MIRRORS=internal)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($MIRRORS)
2004-05-04 21:25:57 +00:00
if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
then AC_MSG_ERROR(
--with-mirrors parameter invalid
)
fi;
if test x$MIRRORS = xinternal; then
AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
2004-05-04 21:25:57 +00:00
fi
################################################################################
dnl -- raid inclusion type
AC_MSG_CHECKING(whether to include raid)
AC_ARG_WITH(raid,
AC_HELP_STRING([--with-raid=TYPE],
[mirror support: internal/shared/none
[[TYPE=internal]]]),
RAID=$withval, RAID=internal)
AC_MSG_RESULT($RAID)
if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]];
then AC_MSG_ERROR(
--with-raid parameter invalid
)
fi;
if test x$RAID = xinternal; then
AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.])
fi
################################################################################
dnl -- asynchronous volume replicator inclusion type
AC_MSG_CHECKING(whether to include replicators)
AC_ARG_WITH(replicators,
AC_HELP_STRING([--with-replicators=TYPE],
[replicator support: internal/shared/none
[[TYPE=none]]]),
REPLICATORS=$withval, REPLICATORS=none)
AC_MSG_RESULT($REPLICATORS)
case "$REPLICATORS" in
none|shared) ;;
internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
[Define to 1 to include built-in support for replicators.]) ;;
*) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
esac
################################################################################
dnl -- thin provisioning
AC_MSG_CHECKING(whether to include thin provisioning)
AC_ARG_WITH(thin,
AC_HELP_STRING([--with-thin=TYPE],
[thin provisioning support: internal/shared/none
[[TYPE=none]]]),
THIN=$withval, THIN=none)
AC_MSG_RESULT($THIN)
case "$THIN" in
none|shared) ;;
internal) AC_DEFINE([THIN_INTERNAL], 1,
[Define to 1 to include built-in support for thin provisioning.]) ;;
*) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
esac
case "$THIN" in
internal|shared)
AC_ARG_WITH(thin-check,
AC_HELP_STRING([--with-thin-check=PATH],
[thin_check tool: [[autodetect]]]),
THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
# Empty means a config way to ignore thin checking
if test "$THIN_CHECK_CMD" = "autodetect"; then
AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
fi
;;
esac
AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
[The path to 'thin_check', if available.])
################################################################################
dnl -- Disable readline
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to enable readline)
AC_ARG_ENABLE([readline],
AC_HELP_STRING([--disable-readline], [disable readline support]),
READLINE=$enableval, READLINE=maybe)
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($READLINE)
2001-09-21 12:37:43 +00:00
################################################################################
dnl -- Disable realtime clock support
AC_MSG_CHECKING(whether to enable realtime support)
AC_ARG_ENABLE(realtime,
AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
REALTIME=$enableval)
AC_MSG_RESULT($REALTIME)
################################################################################
dnl -- disable OCF resource agents
AC_MSG_CHECKING(whether to enable OCF resource agents)
AC_ARG_ENABLE(ocf,
AC_HELP_STRING([--enable-ocf],
[enable Open Cluster Framework (OCF) compliant resource agents]),
OCF=$enableval, OCF=no)
AC_MSG_RESULT($OCF)
AC_ARG_WITH(ocfdir,
AC_HELP_STRING([--with-ocfdir=DIR],
[install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]),
OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2')
################################################################################
dnl -- Init pkg-config with dummy invokation:
dnl -- this is required because PKG_CHECK_MODULES macro is expanded
dnl -- to initialize the pkg-config environment only at the first invokation,
dnl -- that would be conditional in this configure.in.
pkg_config_init() {
PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
[AC_MSG_RESULT([pkg-config initialized])])
PKGCONFIG_INIT=1
}
################################################################################
dnl -- 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
2004-07-03 18:21:13 +00:00
AC_MSG_CHECKING(whether to build cluster LVM daemon)
2004-11-26 18:07:17 +00:00
AC_ARG_WITH(clvmd,
[ --with-clvmd=TYPE build cluster LVM Daemon
The following cluster manager combinations are valid:
2009-08-28 19:22:05 +00:00
* cman (RHEL5 or equivalent)
* cman,corosync,openais (or selection of them)
* singlenode (localhost only)
2009-08-28 19:22:05 +00:00
* all (autodetect)
* none (disable build)
[[TYPE=none]]],
CLVMD=$withval, CLVMD=none)
2004-11-26 18:07:17 +00:00
if test x$CLVMD = xyes; then
CLVMD=all
fi
2004-07-03 18:21:13 +00:00
AC_MSG_RESULT($CLVMD)
dnl -- If clvmd enabled without cluster locking, automagically include it
2004-11-26 18:07:17 +00:00
if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
2004-06-24 08:02:38 +00:00
CLUSTER=internal
fi
dnl -- init pkgconfig if required
if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
dnl -- Express clvmd init script Required-Start / Required-Stop
CLVMD_CMANAGERS=""
dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script.
dnl -- Enable if we are build for cman.
CLVMD_NEEDS_QDISKD=no
2009-08-28 19:22:05 +00:00
dnl -- define build types
if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
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
2009-08-28 19:22:05 +00:00
fi
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
BUILDCOROSYNC=yes
CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
2009-08-28 19:22:05 +00:00
fi
if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
BUILDOPENAIS=yes
CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
2009-08-28 19:22:05 +00:00
fi
if test x$CLVMD_NEEDS_QDISKD != xno; then
CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
2009-08-28 19:22:05 +00:00
fi
dnl -- define a soft bailout if we are autodetecting
soft_bailout() {
NOTFOUND=1
}
hard_bailout() {
AC_MSG_ERROR([bailing out])
}
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 openais|corosync sanity check above.
2009-08-28 19:22:05 +00:00
if test x$CLVMD = xall; then
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.
if test x$BUILDCMAN = xyes; then
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
dnl -- Look for corosync that's required also for openais build
dnl -- only enough recent version of corosync ship pkg-config files.
dnl -- We can safely rely on that to detect the correct bits.
if test x$BUILDCOROSYNC = xyes || \
test x$BUILDOPENAIS = xyes; then
PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
CHECKCONFDB=yes
CHECKCMAP=yes
2009-08-28 19:22:05 +00:00
fi
dnl -- Look for corosync libraries if required.
2009-08-28 19:22:05 +00:00
if test x$BUILDCOROSYNC = xyes; then
PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
CHECKCPG=yes
CHECKDLM=yes
fi
dnl -- Look for openais libraries if required.
if test x$BUILDOPENAIS = xyes; then
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.
dnl -- mandatory for corosync < 2.0 build.
2009-08-28 19:22:05 +00:00
dnl -- optional for openais/cman build.
if test x$CHECKCONFDB = xyes; then
PKG_CHECK_MODULES(CONFDB, libconfdb,
[HAVE_CONFDB=yes],
[HAVE_CONFDB=no])
AC_CHECK_HEADERS(corosync/confdb.h,
[HAVE_CONFDB_H=yes],
[HAVE_CONFDB_H=no])
if test x$HAVE_CONFDB != xyes && \
test x$HAVE_CONFDB_H = xyes; then
check_lib_no_libs confdb confdb_initialize
AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
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])
2009-08-28 19:22:05 +00:00
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 && \
2009-08-28 19:22:05 +00:00
test x$CLVMD != xall; then
AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
2009-08-28 19:22:05 +00:00
fi
fi
dnl -- Check cpg library.
if test x$CHECKCPG = xyes; then
PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout)
fi
dnl -- Check dlm library.
if test x$CHECKDLM = xyes; then
PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
[NOTFOUND=0
AC_CHECK_HEADERS(libdlm.h,,$bailout)
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
dnl -- the depedencies checks and set a proper CLVMD,
dnl -- together with init script Required-Start/Stop entries.
2009-08-28 19:22:05 +00:00
if test x$CLVMD = xall; then
CLVMD=none
CLVMD_CMANAGERS=""
CLVMD_NEEDS_QDISKD=no
2009-08-28 19:22:05 +00:00
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
2009-08-28 19:22:05 +00:00
fi
if test x$HAVE_COROSYNC = xyes && \
test x$HAVE_QUORUM = xyes && \
test x$HAVE_CPG = xyes && \
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
2009-08-28 19:22:05 +00:00
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.])
2009-08-28 19:22:05 +00:00
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,