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.
2009-02-23 01:11:58 +03:00
## Copyright (C) 2004-2009 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"
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"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
2008-06-13 18:37:18 +04:00
LIB_SUFFIX=so
2004-03-26 17:17:14 +03:00
DEVMAPPER=yes
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
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"
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
;;
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
2006-04-19 19:33:07 +04:00
AC_PATH_PROG(CFLOW_CMD, cflow)
AC_PATH_PROG(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
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 \
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 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
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
2008-06-13 18:37:18 +04:00
AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
uname], , [AC_MSG_ERROR(bailing out)])
2009-09-29 01:23:02 +04:00
AC_CHECK_FUNCS(siginterrupt)
2004-07-03 22:21:13 +04:00
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
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,
[ --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)
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,
2009-10-14 08:10:41 +04:00
[ --with-user=USER Set the owner of installed files [[USER=]] ],
2004-04-19 17:10:06 +04:00
[ OWNER="$withval" ])
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($OWNER)
2004-04-19 17:10:06 +04:00
if test x$OWNER != x; then
2010-04-10 01:42:48 +04:00
INSTALL="$INSTALL -o $OWNER"
2004-04-19 17:10:06 +04:00
fi
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,
2009-10-14 08:10:41 +04:00
[ --with-group=GROUP Set the group owner of installed files [[GROUP=]] ],
2004-04-19 17:10:06 +04:00
[ GROUP="$withval" ])
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($GROUP)
2004-04-19 17:10:06 +04:00
if test x$GROUP != x; then
2010-04-10 01:42:48 +04:00
INSTALL="$INSTALL -g $GROUP"
2004-04-19 17:10:06 +04:00
fi
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,
[ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ],
[ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
AC_MSG_RESULT($DM_DEVICE_UID)
################################################################################
dnl -- Setup device group ownership
AC_MSG_CHECKING(device node gid)
AC_ARG_WITH(device-gid,
[ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ],
[ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
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,
[ --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ],
[ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] )
AC_MSG_RESULT($DM_DEVICE_MODE)
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)
2004-04-08 19:23:23 +04:00
AC_ARG_ENABLE(lvm1_fallback, [ --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
if test x$LVM1_FALLBACK = xyes; 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,
[ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
[TYPE=internal] ],
[ LVM1="$withval" ],
[ LVM1="internal" ])
2004-07-03 22:21:13 +04:00
AC_MSG_RESULT($LVM1)
2002-11-18 17:04:08 +03: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 17:24:42 +04:00
if test x$LVM1 = xinternal; then
2006-05-10 01:23:51 +04:00
AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
2003-04-15 17:24:42 +04:00
fi
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,
2004-06-07 23:26:13 +04:00
[ --with-pool=TYPE GFS pool read-only support: internal/shared/none
2004-06-07 23:10:21 +04:00
[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
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
2006-05-10 01:23:51 +04:00
AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
2004-06-07 23:10:21 +04:00
fi
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,
[ --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
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
2006-05-10 01:23:51 +04:00
AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
2004-06-24 12:02:38 +04:00
fi
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,
[ --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
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
2006-05-10 01:23:51 +04:00
AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
2004-05-05 01:25:57 +04:00
fi
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,
[ --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
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
2006-05-10 01:23:51 +04:00
AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
2004-05-05 01:25:57 +04:00
fi
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],
2008-06-27 23:57:27 +04:00
[ --disable-readline Disable readline support],
2008-07-24 18:54:06 +04:00
[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)
2009-10-12 20:59:20 +04:00
AC_ARG_ENABLE(realtime, [ --enable-realtime Enable realtime clock support],
2006-10-01 00:02:02 +04:00
REALTIME=$enableval)
AC_MSG_RESULT($REALTIME)
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() {
PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
[AC_MSG_RESULT([pkg-config initialized])])
PKGCONFIG_INIT=1
}
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,
2009-08-28 23:22:05 +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,gulm (RHEL4 or equivalent)
* 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)
2004-11-26 21:07:17 +03:00
[TYPE=none] ],
[ CLVMD="$withval" ],
[ CLVMD="none" ])
if test x$CLVMD = xyes; then
2005-01-13 16:24:02 +03:00
CLVMD=all
2004-11-03 13:45:07 +03:00
fi
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
2004-11-26 21:07:17 +03:00
if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
2004-06-24 12:02:38 +04:00
CLUSTER=internal
fi
2009-09-15 02:57:46 +04:00
dnl -- init pkgconfig if required
if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
2009-08-28 23:22:05 +04:00
dnl -- define build types
if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
BUILDGULM=yes
fi
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
BUILDCOROSYNC=yes
fi
if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
BUILDOPENAIS=yes
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
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 gulm + openais|corosync sanity check above.
if test x$CLVMD = xall; then
bailout=soft_bailout
BUILDGULM=yes
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 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],
[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
fi
2009-02-26 01:41:12 +03:00
dnl -- Look for corosync libraries if required.
2009-08-28 23:22:05 +04: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 build.
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
if test x$BUILDCOROSYNC = xyes && \
test x$HAVE_CONFDB != xyes &&
test x$CLVMD != xall; then
AC_MSG_ERROR([bailing out... confdb library is required])
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.
if test x$CLVMD = xall; then
2009-09-01 23:11:45 +04:00
CLVMD=none
2009-08-28 23:22:05 +04:00
if test x$HAVE_CCS = xyes && \
test x$HAVE_GULM = xyes; then
2009-09-01 23:11:45 +04:00
AC_MSG_RESULT([Enabling clvmd gulm cluster manager])
CLVMD="$CLVMD,gulm"
2009-08-28 23:22:05 +04:00
fi
if test x$HAVE_CMAN = xyes && \
test x$HAVE_DLM = xyes; then
2009-09-01 23:11:45 +04:00
AC_MSG_RESULT([Enabling clvmd cman cluster manager])
CLVMD="$CLVMD,cman"
2009-08-28 23:22:05 +04:00
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
2009-09-01 23:11:45 +04:00
AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
CLVMD="$CLVMD,corosync"
2009-08-28 23:22:05 +04:00
fi
if test x$HAVE_COROSYNC = xyes && \
test x$HAVE_CPG = xyes && \
test x$HAVE_SALCK = xyes; then
2009-09-01 23:11:45 +04:00
AC_MSG_RESULT([Enabling clvmd openais cluster manager])
CLVMD="$CLVMD,openais"
fi
if test x$CLVMD = xnone; then
AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
2009-08-28 23:22:05 +04:00
fi
2009-02-26 01:41:12 +03:00
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)
AC_ARG_ENABLE(cmirrord, [ --enable-cmirrord Enable the cluster mirror log daemon],
CMIRRORD=$enableval, CMIRRORD=no)
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
AH_TEMPLATE(CMIRRORD_PIDFILE, [Path to cmirrord pidfile.])
if test "x$BUILD_CMIRRORD" = xyes; then
AC_ARG_WITH(cmirrord-pidfile,
[ --with-cmirrord-pidfile=PATH cmirrord pidfile [[/var/run/cmirrord.pid]] ],
[ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"$withval") ],
[ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"/var/run/cmirrord.pid") ])
fi
################################################################################
2009-08-13 20:34:07 +04:00
dnl -- Look for corosync libraries if required.
2009-08-29 00:51:40 +04:00
if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
2009-09-15 02:57:46 +04:00
dnl -- init pkgconfig if required
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
PKG_CHECK_MODULES(SACKPT, libSaCkpt)
if test x$HAVE_CPG != xyes; 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)
AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
2008-06-13 18:37:18 +04:00
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
if test x$DEBUG = xyes; then
COPTIMISE_FLAG=
2006-04-19 19:33:07 +04:00
else
CSCOPE_CMD=
2004-06-29 17:29:25 +04:00
fi
################################################################################
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,
2008-06-13 18:37:18 +04:00
[ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
2004-06-29 17:29:25 +04:00
[ 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,
2008-06-27 23:24:17 +04:00
AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
PROFILING=$enableval, PROFILING=no)
AC_MSG_RESULT($PROFILING)
if test "x$PROFILING" = xyes; then
COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
2010-04-06 15:53:53 +04:00
AC_PATH_PROG(LCOV, lcov)
AC_PATH_PROG(GENHTML, genhtml)
if test -z "$LCOV" -o -z "$GENHTML"; then
2008-08-05 18:29:38 +04:00
AC_MSG_ERROR([lcov and genhtml are required for profiling])
fi
2010-04-06 15:53:53 +04:00
AC_PATH_PROG(GENPNG, genpng)
if test -n "$GENPNG"; then
AC_MSG_CHECKING([whether $GENPNG has all required modules])
if $GENPNG --help > /dev/null 2>&1 ; then
AC_MSG_RESULT(ok)
GENHTML="$GENHTML --frames"
else
AC_MSG_RESULT(not supported)
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
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)
2008-11-01 01:06:09 +03:00
AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction],
2004-07-03 22:21:13 +04:00
DEVMAPPER=$enableval)
AC_MSG_RESULT($DEVMAPPER)
2003-01-09 01:44:07 +03:00
2003-04-15 17:24:42 +04:00
if test x$DEVMAPPER = xyes; 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
2009-07-31 15:49:53 +04:00
################################################################################
dnl -- Enable udev synchronisation
AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
AC_ARG_ENABLE(udev_sync, [ --enable-udev_sync Enable synchronisation with udev processing],
UDEV_SYNC=$enableval, UDEV_SYNC=no)
AC_MSG_RESULT($UDEV_SYNC)
if test x$UDEV_SYNC = xyes; then
2010-03-23 17:43:18 +03:00
AC_CHECK_LIB(udev, udev_queue_get_udev_is_active, UDEV_LIBS="-ludev", AC_MSG_ERROR(bailing out... libudev library is required))
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)
AC_ARG_ENABLE(udev_rules, [ --enable-udev_rules Install rule files needed for udev synchronisation],
UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
AC_MSG_RESULT($UDEV_RULES)
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Compatibility mode
AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
DM_COMPAT=$enableval, DM_COMPAT=no)
2009-09-28 20:23:44 +04:00
################################################################################
dnl -- Compatible units suffix mode
AC_ARG_ENABLE(units-compat,
[ --enable-units-compat Enable output compatibility with old versions that
that don't use KiB-style unit suffixes],
UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
if test x$UNITS_COMPAT = xyes; then
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
AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
DM_IOCTLS=$enableval)
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)
AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT],
ODIRECT=$enableval)
AC_MSG_RESULT($ODIRECT)
2003-11-06 20:14:06 +03:00
if test x$ODIRECT = xyes; 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,
[ --enable-applib Build application library],
APPLIB=$enableval, APPLIB=no)
AC_MSG_RESULT($APPLIB)
AC_SUBST([LVM2APP_LIB])
test x$APPLIB = xyes \
&& 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)
AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
CMDLIB=$enableval, CMDLIB=no)
AC_MSG_RESULT($CMDLIB)
2008-06-23 13:25:08 +04:00
AC_SUBST([LVM2CMD_LIB])
2008-07-09 13:59:42 +04:00
test x$CMDLIB = xyes \
2008-06-23 13:25:08 +04:00
&& LVM2CMD_LIB=-llvm2cmd \
|| LVM2CMD_LIB=
2004-03-26 17:17:14 +03:00
2008-11-01 01:06:09 +03:00
################################################################################
dnl -- Enable pkg-config
AC_ARG_ENABLE(pkgconfig, [ --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
AC_ARG_ENABLE(write_install, AC_HELP_STRING([--enable-write_install],
[Install user writable files]),
[WRITE_INSTALL=$enableval], [WRITE_INSTALL=no])
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-03-04 14:09:08 +03: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
2005-12-02 22:52:06 +03:00
################################################################################
dnl -- enable dmeventd handling
AC_MSG_CHECKING(whether to use dmeventd)
AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon],
DMEVENTD=$enableval)
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
2008-07-09 13:59:42 +04:00
if test x$DMEVENTD = xyes; then
if test x$MIRRORS != xinternal; then
AC_MSG_ERROR(
--enable-dmeventd currently requires --with-mirrors=internal
)
fi
if test x$CMDLIB = xno; then
AC_MSG_ERROR(
--enable-dmeventd requires --enable-cmdlib to be used as well
)
fi
2005-12-02 22:52:06 +03:00
fi
2005-12-02 23:35:07 +03:00
if test x$DMEVENTD = xyes; then
2006-05-10 01:23:51 +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
2001-09-21 16:37:43 +04:00
if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
then exec_prefix="";
fi;
2004-06-28 18:01:24 +04:00
################################################################################
2004-06-29 17:29:25 +04:00
dnl -- Check for dlopen
2010-03-04 15:10:40 +03:00
AC_CHECK_LIB(dl, dlopen, [
2006-05-10 01:23:51 +04:00
AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
2010-03-04 15:10:40 +03:00
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
2004-06-28 18:01:24 +04:00
if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
-o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
2004-05-05 01:25:57 +04:00
\) -a "x$STATIC_LINK" = xyes ]];
2004-04-05 20:29:37 +04:00
then AC_MSG_ERROR(
2004-04-07 18:08:22 +04:00
Features cannot be 'shared' when building statically
2004-04-05 20:29:37 +04:00
)
2004-04-07 18:08:22 +04:00
fi
2010-03-04 14:21:05 +03:00
################################################################################
if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
AC_CHECK_LIB([pthread], [pthread_mutex_lock],
[PTHREAD_LIBS="-lpthread"], hard_bailout)
fi
2008-06-13 18:37:18 +04:00
################################################################################
dnl -- Disable selinux
AC_MSG_CHECKING(whether to enable selinux support)
AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
SELINUX=$enableval)
AC_MSG_RESULT($SELINUX)
2004-06-28 18:01:24 +04:00
################################################################################
2006-04-19 19:33:07 +04:00
dnl -- Check for selinux
2004-06-28 18:01:24 +04:00
if test x$SELINUX = xyes; 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)
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-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=
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
if test x$REALTIME = xyes; then
AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
if test x$HAVE_REALTIME = xyes; then
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)
2008-07-24 18:54:06 +04:00
if test x$READLINE != xno; 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)
AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
INTL=$enableval, INTL=no)
AC_MSG_RESULT($INTL)
2004-02-14 01:56:45 +03:00
if test x$INTL = xyes; 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"
AC_PATH_PROG(MSGFMT, msgfmt)
if [[ "x$MSGFMT" == x ]];
then AC_MSG_ERROR(
msgfmt not found in path $PATH
)
fi;
AC_ARG_WITH(localedir,
2008-06-13 18:37:18 +04:00
[ --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
################################################################################
2004-04-14 21:39:55 +04:00
AC_ARG_WITH(confdir,
2009-07-31 15:49:53 +04:00
[ --with-confdir=DIR Configuration files in DIR [[/etc]]],
2008-06-13 18:37:18 +04:00
[ CONFDIR="$withval" ],
[ CONFDIR='/etc' ])
2004-04-14 22:00:23 +04:00
AC_ARG_WITH(staticdir,
2009-07-31 15:49:53 +04:00
[ --with-staticdir=DIR Static binary in DIR [[EPREFIX/sbin]]],
2008-06-13 18:37:18 +04:00
[ STATICDIR="$withval" ],
[ STATICDIR='${exec_prefix}/sbin' ])
2004-04-14 22:00:23 +04:00
2008-10-07 23:11:59 +04:00
AC_ARG_WITH(usrlibdir,
[ --with-usrlibdir=DIR],
[ usrlibdir="$withval"],
[ usrlibdir='${prefix}/lib' ])
AC_ARG_WITH(usrsbindir,
[ --with-usrsbindir=DIR],
[ usrsbindir="$withval"],
[ usrsbindir='${prefix}/sbin' ])
2009-07-31 15:49:53 +04:00
################################################################################
AC_ARG_WITH(udev_prefix,
[ --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [[EPREFIX]]],
[ udev_prefix="$withval"],
[ udev_prefix='${exec_prefix}' ])
2009-07-31 17:31:53 +04:00
AC_ARG_WITH(udevdir,
[ --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
2004-07-03 22:21:13 +04:00
################################################################################
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))
fi
2005-01-13 16:24:02 +03:00
if test x$CLVMD != xnone; 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))
AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
AC_FUNC_GETMNTENT
# AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
fi
if test x$CLUSTER != xnone; then
AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
fi
if test x$HAVE_LIBDL = xyes; then
AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
fi
if test x$INTL = xyes; then
AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
fi
2009-07-31 15:49:53 +04:00
if test x$UDEV_SYNC = xyes; then
AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
fi
2005-10-17 21:56:27 +04:00
################################################################################
AC_PATH_PROG(MODPROBE_CMD, modprobe)
if test x$MODPROBE_CMD != x; 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
2004-06-28 18:01:24 +04:00
################################################################################
2008-11-01 01:06:09 +03:00
dnl -- dmeventd pidfile and executable path
AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
if test "$BUILD_DMEVENTD" = yes; then
AC_ARG_WITH(dmeventd-pidfile,
[ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
[ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
[ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
fi
AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
if test "$BUILD_DMEVENTD" = yes; then
dmeventd_prefix="$exec_prefix"
if test "x$dmeventd_prefix" = "xNONE"; then
dmeventd_prefix="$prefix"
fi
if test "x$dmeventd_prefix" = "xNONE"; then
dmeventd_prefix=""
fi
AC_ARG_WITH(dmeventd-path,
2009-07-31 15:49:53 +04:00
[ --with-dmeventd-path=PATH dmeventd path [[EPREFIX/sbin/dmeventd]] ],
2008-11-01 01:06:09 +03:00
[ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
[ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
fi
################################################################################
dnl -- which kernel interface to use (ioctl only)
AC_MSG_CHECKING(for kernel interface choice)
AC_ARG_WITH(interface,
[ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ],
[ interface="$withval" ],
[ interface=ioctl ])
if [[ "x$interface" != xioctl ]];
then
AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
fi
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)
2009-08-29 00:51:40 +04:00
AC_SUBST(BUILD_CMIRRORD)
2008-06-13 18:37:18 +04:00
AC_SUBST(BUILD_DMEVENTD)
2009-08-28 23:22:05 +04:00
AC_SUBST(CCS_CFLAGS)
AC_SUBST(CCS_LIBS)
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)
2009-08-28 23:22:05 +04:00
AC_SUBST(CMAN_CFLAGS)
AC_SUBST(CMAN_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)
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)
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)
2008-06-13 18:37:18 +04:00
AC_SUBST(FSADM)
2009-08-28 23:22:05 +04:00
AC_SUBST(GULM_CFLAGS)
AC_SUBST(GULM_LIBS)
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)
AC_SUBST(LVM_RELEASE)
AC_SUBST(LVM_RELEASE_DATE)
2008-06-13 18:37:18 +04:00
AC_SUBST(MIRRORS)
AC_SUBST(MSGFMT)
AC_SUBST(PKGCONFIG)
AC_SUBST(POOL)
2010-03-04 14:21:05 +03:00
AC_SUBST(PTHREAD_LIBS)
2009-02-26 01:41:12 +03:00
AC_SUBST(QUORUM_CFLAGS)
AC_SUBST(QUORUM_LIBS)
2010-03-04 14:19:15 +03:00
AC_SUBST(READLINE_LIBS)
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)
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-03-04 15:12:34 +03:00
AC_SUBST(UDEV_LIBS)
2009-07-31 15:49:53 +04:00
AC_SUBST(UDEV_RULES)
2010-01-11 18:48:49 +03:00
AC_SUBST(UDEV_SYNC)
2010-04-10 01:42:48 +04:00
AC_SUBST(WRITE_INSTALL)
2008-11-01 01:06:09 +03:00
AC_SUBST(interface)
AC_SUBST(kerneldir)
AC_SUBST(missingkernel)
AC_SUBST(kernelvsn)
AC_SUBST(tmpdir)
2009-07-31 15:49:53 +04:00
AC_SUBST(udev_prefix)
AC_SUBST(udevdir)
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
2008-11-01 01:06:09 +03:00
daemons/dmeventd/plugins/mirror/Makefile
daemons/dmeventd/plugins/snapshot/Makefile
2007-09-18 22:26:32 +04:00
doc/Makefile
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
2009-02-23 01:11:58 +03:00
lib/misc/lvm-version.h
2007-09-18 22:26:32 +04:00
lib/snapshot/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
2008-11-19 22:33:25 +03:00
scripts/clvmd_init_red_hat
2010-01-19 05:04:33 +03:00
scripts/cmirrord_init_red_hat
2009-09-17 03:22:40 +04:00
scripts/lvm2_monitoring_init_red_hat
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
2007-09-18 22:26:32 +04:00
tools/Makefile
2009-07-31 15:49:53 +04:00
udev/Makefile
2007-08-14 23:11:31 +04:00
])
AC_OUTPUT
2003-11-06 20:14:06 +03:00
if test x$ODIRECT != xyes; then
2004-07-03 22:21:13 +04:00
AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2003-11-06 20:14:06 +03:00
fi