1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

configure: cleanups

Replace AC_PATH_PROG with AC_PATH_TOOL.
Drop 'x' when already using "" around shell variable.
Simlify some long line and ifs.
Merge multiple test evaluation with '-a', '-o'.
Use 'case' instead if several ifs when it's more elegant.
Improve usage of pkg_config_init and add it where it's been missing.
Check for UDEV_HAS_BUILTIN_BLKID and when building udev-rules.
This commit is contained in:
Zdenek Kabelac 2014-06-05 17:28:03 +02:00
parent b3ace4f9af
commit 7cead4afea

View File

@ -77,8 +77,8 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PATH_PROG(CFLOW_CMD, cflow) AC_PATH_TOOL(CFLOW_CMD, cflow)
AC_PATH_PROG(CSCOPE_CMD, cscope) AC_PATH_TOOL(CSCOPE_CMD, cscope)
################################################################################ ################################################################################
dnl -- Check for header files. dnl -- Check for header files.
@ -176,10 +176,7 @@ AC_ARG_WITH(user,
[set the owner of installed files [[USER=]]]), [set the owner of installed files [[USER=]]]),
OWNER=$withval) OWNER=$withval)
AC_MSG_RESULT($OWNER) AC_MSG_RESULT($OWNER)
test -n "$OWNER" && INSTALL="$INSTALL -o $OWNER"
if test x$OWNER != x; then
INSTALL="$INSTALL -o $OWNER"
fi
################################################################################ ################################################################################
dnl -- Setup the group ownership of the files dnl -- Setup the group ownership of the files
@ -189,10 +186,7 @@ AC_ARG_WITH(group,
[set the group owner of installed files [[GROUP=]]]), [set the group owner of installed files [[GROUP=]]]),
GROUP=$withval) GROUP=$withval)
AC_MSG_RESULT($GROUP) AC_MSG_RESULT($GROUP)
test -n "$GROUP" && INSTALL="$INSTALL -g $GROUP"
if test x$GROUP != x; then
INSTALL="$INSTALL -g $GROUP"
fi
################################################################################ ################################################################################
dnl -- Setup device node ownership dnl -- Setup device node ownership
@ -261,7 +255,7 @@ AC_ARG_ENABLE(lvm1_fallback,
LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no) LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
AC_MSG_RESULT($LVM1_FALLBACK) AC_MSG_RESULT($LVM1_FALLBACK)
if test x$LVM1_FALLBACK = xyes; then if test "$LVM1_FALLBACK" = yes; 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]) 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 fi
@ -273,17 +267,15 @@ AC_ARG_WITH(lvm1,
[LVM1 metadata support: internal/shared/none [LVM1 metadata support: internal/shared/none
[[TYPE=internal]]]), [[TYPE=internal]]]),
LVM1=$withval, LVM1=internal) LVM1=$withval, LVM1=internal)
AC_MSG_RESULT($LVM1) AC_MSG_RESULT($LVM1)
if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]]; case "$LVM1" in
then AC_MSG_ERROR( none|share) ;;
--with-lvm1 parameter invalid internal) AC_DEFINE([LVM1_INTERNAL], 1,
) [Define to 1 to include built-in support for LVM1 metadata.]) ;;
fi; *) AC_MSG_ERROR([--with-lvm1 parameter invalid]) ;;
esac
if test x$LVM1 = xinternal; then
AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
fi
################################################################################ ################################################################################
dnl -- format_pool inclusion type dnl -- format_pool inclusion type
@ -295,15 +287,12 @@ AC_ARG_WITH(pool,
POOL=$withval, POOL=internal) POOL=$withval, POOL=internal)
AC_MSG_RESULT($POOL) AC_MSG_RESULT($POOL)
if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]]; case "$POOL" in
then AC_MSG_ERROR( none|shared) ;;
--with-pool parameter invalid internal) AC_DEFINE([POOL_INTERNAL], 1,
) [Define to 1 to include built-in support for GFS pool metadata.]) ;;
fi; *) AC_MSG_ERROR([--with-pool parameter invalid])
esac
if test x$POOL = xinternal; then
AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
fi
################################################################################ ################################################################################
dnl -- cluster_locking inclusion type dnl -- cluster_locking inclusion type
@ -315,15 +304,12 @@ AC_ARG_WITH(cluster,
CLUSTER=$withval) CLUSTER=$withval)
AC_MSG_RESULT($CLUSTER) AC_MSG_RESULT($CLUSTER)
if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]]; case "$CLUSTER" in
then AC_MSG_ERROR( none|shared) ;;
--with-cluster parameter invalid internal) AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1,
) [Define to 1 to include built-in support for clustered LVM locking.]) ;;
fi; *) AC_MSG_ERROR([--with-cluster parameter invalid]) ;;
esac
if test x$CLUSTER = xinternal; then
AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
fi
################################################################################ ################################################################################
dnl -- snapshots inclusion type dnl -- snapshots inclusion type
@ -335,15 +321,12 @@ AC_ARG_WITH(snapshots,
SNAPSHOTS=$withval, SNAPSHOTS=internal) SNAPSHOTS=$withval, SNAPSHOTS=internal)
AC_MSG_RESULT($SNAPSHOTS) AC_MSG_RESULT($SNAPSHOTS)
if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]]; case "$SNAPSHOTS" in
then AC_MSG_ERROR( none|shared) ;;
--with-snapshots parameter invalid internal) AC_DEFINE([SNAPSHOT_INTERNAL], 1,
) [Define to 1 to include built-in support for snapshots.]) ;;
fi; *) AC_MSG_ERROR([--with-snapshots parameter invalid]) ;;
esac
if test x$SNAPSHOTS = xinternal; then
AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
fi
################################################################################ ################################################################################
dnl -- mirrors inclusion type dnl -- mirrors inclusion type
@ -355,15 +338,12 @@ AC_ARG_WITH(mirrors,
MIRRORS=$withval, MIRRORS=internal) MIRRORS=$withval, MIRRORS=internal)
AC_MSG_RESULT($MIRRORS) AC_MSG_RESULT($MIRRORS)
if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]]; case "$MIRRORS" in
then AC_MSG_ERROR( none|shared) ;;
--with-mirrors parameter invalid internal) AC_DEFINE([MIRRORED_INTERNAL], 1,
) [Define to 1 to include built-in support for mirrors.]) ;;
fi; *) AC_MSG_ERROR([--with-mirrors parameter invalid]) ;;
esac
if test x$MIRRORS = xinternal; then
AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
fi
################################################################################ ################################################################################
dnl -- raid inclusion type dnl -- raid inclusion type
@ -375,15 +355,12 @@ AC_ARG_WITH(raid,
RAID=$withval, RAID=internal) RAID=$withval, RAID=internal)
AC_MSG_RESULT($RAID) AC_MSG_RESULT($RAID)
if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]]; case "$RAID" in
then AC_MSG_ERROR( none|shared) ;;
--with-raid parameter invalid internal) AC_DEFINE([RAID_INTERNAL], 1,
) [Define to 1 to include built-in support for raid.]) ;;
fi; *) AC_MSG_ERROR([--with-raid parameter invalid]) ;;
esac
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 dnl -- asynchronous volume replicator inclusion type
@ -432,7 +409,7 @@ AC_MSG_RESULT($THIN)
case "$THIN" in case "$THIN" in
none|shared) ;; none|shared) ;;
internal) AC_DEFINE([THIN_INTERNAL], 1, internal) AC_DEFINE([THIN_INTERNAL], 1,
[Define to 1 to include built-in support for thin provisioning.]) ;; [Define to 1 to include built-in support for thin provisioning.]) ;;
*) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;; *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
esac esac
@ -528,15 +505,11 @@ AC_ARG_WITH(cache,
CACHE=$withval, CACHE=none) CACHE=$withval, CACHE=none)
AC_MSG_RESULT($CACHE) AC_MSG_RESULT($CACHE)
if [[ "x$CACHE" != xnone -a "x$CACHE" != xinternal -a "x$CACHE" != xshared ]]; case "$CACHE" in
then AC_MSG_ERROR( none|shared) ;;
--with-cache parameter invalid internal) AC_DEFINE([CACHE_INTERNAL], 1, [Define to 1 to include built-in support for cache.]) ;;
) *) AC_MSG_ERROR([--with-cache parameter invalid]) ;;
fi; esac
if test x$CACHE = xinternal; then
AC_DEFINE([CACHE_INTERNAL], 1, [Define to 1 to include built-in support for cache.])
fi
################################################################################ ################################################################################
dnl -- Disable readline dnl -- Disable readline
@ -573,9 +546,11 @@ dnl -- this is required because PKG_CHECK_MODULES macro is expanded
dnl -- to initialize the pkg-config environment only at the first invokation, dnl -- to initialize the pkg-config environment only at the first invokation,
dnl -- that would be conditional in this configure.in. dnl -- that would be conditional in this configure.in.
pkg_config_init() { pkg_config_init() {
PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [], if test "$PKGCONFIG_INIT" != 1; then
[AC_MSG_RESULT([pkg-config initialized])]) PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
PKGCONFIG_INIT=1 [AC_MSG_RESULT([pkg-config initialized])])
PKGCONFIG_INIT=1
fi
} }
################################################################################ ################################################################################
@ -617,20 +592,14 @@ AC_ARG_WITH(clvmd,
* none (disable build) * none (disable build)
[[TYPE=none]]], [[TYPE=none]]],
CLVMD=$withval, CLVMD=none) CLVMD=$withval, CLVMD=none)
if test x$CLVMD = xyes; then test "$CLVMD" = yes && CLVMD=all
CLVMD=all
fi
AC_MSG_RESULT($CLVMD) AC_MSG_RESULT($CLVMD)
dnl -- If clvmd enabled without cluster locking, automagically include it dnl -- If clvmd enabled without cluster locking, automagically include it
if test x$CLVMD != xnone && test x$CLUSTER = xnone; then test "$CLVMD" != none -a "$CLUSTER" = none && CLUSTER=internal
CLUSTER=internal
fi
dnl -- init pkgconfig if required dnl -- init pkgconfig if required
if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then test "$CLVMD" != none && pkg_config_init
pkg_config_init
fi
dnl -- Express clvmd init script Required-Start / Required-Stop dnl -- Express clvmd init script Required-Start / Required-Stop
CLVMD_CMANAGERS="" CLVMD_CMANAGERS=""
@ -655,9 +624,7 @@ if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
BUILDOPENAIS=yes BUILDOPENAIS=yes
CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais" CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
fi fi
if test x$CLVMD_NEEDS_QDISKD != xno; then test "$CLVMD_NEEDS_QDISKD" != no && CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
fi
dnl -- define a soft bailout if we are autodetecting dnl -- define a soft bailout if we are autodetecting
soft_bailout() { soft_bailout() {
@ -668,10 +635,10 @@ hard_bailout() {
AC_MSG_ERROR([bailing out]) AC_MSG_ERROR([bailing out])
} }
dnl -- if clvmd=all then set soft_bailout (we don't want to error) dnl -- if clvmd=all then set soft_bailout (we do not want to error)
dnl -- and set all builds to yes. We need to do this here dnl -- and set all builds to yes. We need to do this here
dnl -- to skip the openais|corosync sanity check above. dnl -- to skip the openais|corosync sanity check above.
if test x$CLVMD = xall; then if test "$CLVMD" = all; then
bailout=soft_bailout bailout=soft_bailout
BUILDCMAN=yes BUILDCMAN=yes
BUILDCOROSYNC=yes BUILDCOROSYNC=yes
@ -695,7 +662,7 @@ check_lib_no_libs() {
} }
dnl -- Look for cman libraries if required. dnl -- Look for cman libraries if required.
if test x$BUILDCMAN = xyes; then if test "$BUILDCMAN" = yes; then
PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes], PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
[NOTFOUND=0 [NOTFOUND=0
AC_CHECK_HEADERS(libcman.h,,$bailout) AC_CHECK_HEADERS(libcman.h,,$bailout)
@ -709,25 +676,24 @@ if test x$BUILDCMAN = xyes; then
CHECKDLM=yes CHECKDLM=yes
fi fi
dnl -- Look for corosync that's required also for openais build dnl -- Look for corosync that is required also for openais build
dnl -- only enough recent version of corosync ship pkg-config files. dnl -- only enough recent version of corosync ship pkg-config files.
dnl -- We can safely rely on that to detect the correct bits. dnl -- We can safely rely on that to detect the correct bits.
if test x$BUILDCOROSYNC = xyes || \ if test "$BUILDCOROSYNC" = yes -o "$BUILDOPENAIS" = yes; then
test x$BUILDOPENAIS = xyes; then
PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout) PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
CHECKCONFDB=yes CHECKCONFDB=yes
CHECKCMAP=yes CHECKCMAP=yes
fi fi
dnl -- Look for corosync libraries if required. dnl -- Look for corosync libraries if required.
if test x$BUILDCOROSYNC = xyes; then if test "$BUILDCOROSYNC" = yes; then
PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout) PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
CHECKCPG=yes CHECKCPG=yes
CHECKDLM=yes CHECKDLM=yes
fi fi
dnl -- Look for openais libraries if required. dnl -- Look for openais libraries if required.
if test x$BUILDOPENAIS = xyes; then if test "$BUILDOPENAIS" = yes; then
PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout) PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
CHECKCPG=yes CHECKCPG=yes
fi fi
@ -738,17 +704,14 @@ dnl -- Check confdb library.
dnl -- mandatory for corosync < 2.0 build. dnl -- mandatory for corosync < 2.0 build.
dnl -- optional for openais/cman build. dnl -- optional for openais/cman build.
if test x$CHECKCONFDB = xyes; then if test "$CHECKCONFDB" = yes; then
PKG_CHECK_MODULES(CONFDB, libconfdb, PKG_CHECK_MODULES(CONFDB, libconfdb,
[HAVE_CONFDB=yes], [HAVE_CONFDB=yes], [HAVE_CONFDB=no])
[HAVE_CONFDB=no])
AC_CHECK_HEADERS(corosync/confdb.h, AC_CHECK_HEADERS([corosync/confdb.h],
[HAVE_CONFDB_H=yes], [HAVE_CONFDB_H=yes], [HAVE_CONFDB_H=no])
[HAVE_CONFDB_H=no])
if test x$HAVE_CONFDB != xyes && \ if test "$HAVE_CONFDB" != yes -a "$HAVE_CONFDB_H" = yes; then
test x$HAVE_CONFDB_H = xyes; then
check_lib_no_libs confdb confdb_initialize check_lib_no_libs confdb confdb_initialize
AC_MSG_RESULT([no pkg for confdb, using -lconfdb]) AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
CONFDB_LIBS="-lconfdb" CONFDB_LIBS="-lconfdb"
@ -759,17 +722,14 @@ fi
dnl -- Check cmap library dnl -- Check cmap library
dnl -- mandatory for corosync >= 2.0 build. dnl -- mandatory for corosync >= 2.0 build.
if test x$CHECKCMAP = xyes; then if test "$CHECKCMAP" = yes; then
PKG_CHECK_MODULES(CMAP, libcmap, PKG_CHECK_MODULES(CMAP, libcmap,
[HAVE_CMAP=yes], [HAVE_CMAP=yes], [HAVE_CMAP=no])
[HAVE_CMAP=no])
AC_CHECK_HEADERS(corosync/cmap.h, AC_CHECK_HEADERS([corosync/cmap.h],
[HAVE_CMAP_H=yes], [HAVE_CMAP_H=yes], [HAVE_CMAP_H=no])
[HAVE_CMAP_H=no])
if test x$HAVE_CMAP != xyes && \ if test "$HAVE_CMAP" != yes -a "$HAVE_CMAP_H" = yes; then
test x$HAVE_CMAP_H = xyes; then
check_lib_no_libs cmap cmap_initialize check_lib_no_libs cmap cmap_initialize
AC_MSG_RESULT([no pkg for cmap, using -lcmap]) AC_MSG_RESULT([no pkg for cmap, using -lcmap])
CMAP_LIBS="-lcmap" CMAP_LIBS="-lcmap"
@ -777,24 +737,21 @@ if test x$CHECKCMAP = xyes; then
fi fi
fi fi
if test x$BUILDCOROSYNC = xyes; then if test "$BUILDCOROSYNC" = yes -a \
if test x$HAVE_CMAP != xyes && \ "$HAVE_CMAP" != yes -a "$HAVE_CONFDB" != yes -a "$CLVMD" != all; then
test x$HAVE_CONFDB != xyes && \ AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
test x$CLVMD != xall; then
AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
fi
fi fi
dnl -- Check cpg library. dnl -- Check cpg library.
if test x$CHECKCPG = xyes; then if test "$CHECKCPG" = yes; then
PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout) PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], [$bailout])
fi fi
dnl -- Check dlm library. dnl -- Check dlm library.
if test x$CHECKDLM = xyes; then if test "$CHECKDLM" = yes; then
PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes], PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
[NOTFOUND=0 [NOTFOUND=0
AC_CHECK_HEADERS(libdlm.h,,$bailout) AC_CHECK_HEADERS(libdlm.h,,[$bailout])
check_lib_no_libs dlm dlm_lock -lpthread check_lib_no_libs dlm dlm_lock -lpthread
if test $NOTFOUND = 0; then if test $NOTFOUND = 0; then
AC_MSG_RESULT([no pkg for libdlm, using -ldlm]) AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
@ -806,54 +763,48 @@ fi
dnl -- If we are autodetecting, we need to re-create 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. dnl -- together with init script Required-Start/Stop entries.
if test x$CLVMD = xall; then if test "$CLVMD" = all; then
CLVMD=none CLVMD=none
CLVMD_CMANAGERS="" CLVMD_CMANAGERS=""
CLVMD_NEEDS_QDISKD=no CLVMD_NEEDS_QDISKD=no
if test x$HAVE_CMAN = xyes && \ if test "$HAVE_CMAN" = yes -a \
test x$HAVE_DLM = xyes; then "$HAVE_DLM" = yes; then
AC_MSG_RESULT([Enabling clvmd cman cluster manager]) AC_MSG_RESULT([Enabling clvmd cman cluster manager])
CLVMD="$CLVMD,cman" CLVMD="$CLVMD,cman"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman" CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman"
CLVMD_NEEDS_QDISKD=yes CLVMD_NEEDS_QDISKD=yes
fi fi
if test x$HAVE_COROSYNC = xyes && \ if test "$HAVE_COROSYNC" = yes -a \
test x$HAVE_QUORUM = xyes && \ "$HAVE_QUORUM" = yes -a \
test x$HAVE_CPG = xyes && \ "$HAVE_CPG" = yes -a \
test x$HAVE_DLM = xyes; then "$HAVE_DLM" = yes; then
if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then if test "$HAVE_CONFDB" = yes -o "$HAVE_CMAP" = yes; then
AC_MSG_RESULT([Enabling clvmd corosync cluster manager]) AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
CLVMD="$CLVMD,corosync" CLVMD="$CLVMD,corosync"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync" CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
fi fi
fi fi
if test x$HAVE_COROSYNC = xyes && \ if test "$HAVE_COROSYNC" = yes -a \
test x$HAVE_CPG = xyes && \ "$HAVE_CPG" = yes -a \
test x$HAVE_SALCK = xyes; then "$HAVE_SALCK" = yes; then
AC_MSG_RESULT([Enabling clvmd openais cluster manager]) AC_MSG_RESULT([Enabling clvmd openais cluster manager])
CLVMD="$CLVMD,openais" CLVMD="$CLVMD,openais"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais" CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais"
fi fi
if test x$CLVMD_NEEDS_QDISKD != xno; then test "$CLVMD_NEEDS_QDISKD" != no && CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd" test "$CLVMD" = none && AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
fi
if test x$CLVMD = xnone; then
AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
fi
fi fi
dnl -- Fixup CLVMD_CMANAGERS with new corosync dnl -- Fixup CLVMD_CMANAGERS with new corosync
dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service) dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
dnl -- to be started. dnl -- to be started.
if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
if test x$HAVE_CMAP = xyes; then test "$HAVE_CMAP" = yes && CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
fi
fi fi
################################################################################ ################################################################################
dnl -- clvmd pidfile dnl -- clvmd pidfile
if test "x$CLVMD" != xnone; then if test "$CLVMD" != none; then
AC_ARG_WITH(clvmd-pidfile, AC_ARG_WITH(clvmd-pidfile,
AC_HELP_STRING([--with-clvmd-pidfile=PATH], AC_HELP_STRING([--with-clvmd-pidfile=PATH],
[clvmd pidfile [[PID_DIR/clvmd.pid]]]), [clvmd pidfile [[PID_DIR/clvmd.pid]]]),
@ -876,7 +827,7 @@ BUILD_CMIRRORD=$CMIRRORD
################################################################################ ################################################################################
dnl -- cmirrord pidfile dnl -- cmirrord pidfile
if test "x$BUILD_CMIRRORD" = xyes; then if test "$BUILD_CMIRRORD" = yes; then
AC_ARG_WITH(cmirrord-pidfile, AC_ARG_WITH(cmirrord-pidfile,
AC_HELP_STRING([--with-cmirrord-pidfile=PATH], AC_HELP_STRING([--with-cmirrord-pidfile=PATH],
[cmirrord pidfile [[PID_DIR/cmirrord.pid]]]), [cmirrord pidfile [[PID_DIR/cmirrord.pid]]]),
@ -888,20 +839,15 @@ fi
################################################################################ ################################################################################
dnl -- Look for corosync libraries if required. dnl -- Look for corosync libraries if required.
if [[ "x$BUILD_CMIRRORD" = xyes ]]; then if [[ "$BUILD_CMIRRORD" = yes ]]; then
dnl -- init pkgconfig if required pkg_config_init
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.]) AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes], PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
[AC_MSG_RESULT([no libSaCkpt, compiling without it]) [AC_MSG_RESULT([no libSaCkpt, compiling without it])
AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])]) AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
if test x$HAVE_CPG != xyes; then test "$HAVE_CPG" != yes && PKG_CHECK_MODULES(CPG, libcpg)
PKG_CHECK_MODULES(CPG, libcpg)
fi
fi fi
################################################################################ ################################################################################
@ -912,7 +858,7 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]),
AC_MSG_RESULT($DEBUG) AC_MSG_RESULT($DEBUG)
dnl -- Normally turn off optimisation for debug builds dnl -- Normally turn off optimisation for debug builds
if test x$DEBUG = xyes; then if test "$DEBUG" = yes; then
COPTIMISE_FLAG= COPTIMISE_FLAG=
else else
CSCOPE_CMD= CSCOPE_CMD=
@ -937,25 +883,24 @@ AC_MSG_RESULT($COPTIMISE_FLAG)
dnl -- Enable profiling dnl -- Enable profiling
AC_MSG_CHECKING(whether to gather gcov profiling data) AC_MSG_CHECKING(whether to gather gcov profiling data)
AC_ARG_ENABLE(profiling, AC_ARG_ENABLE(profiling,
AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]), AC_HELP_STRING([--enable-profiling],
[gather gcov profiling data]),
PROFILING=$enableval, PROFILING=no) PROFILING=$enableval, PROFILING=no)
AC_MSG_RESULT($PROFILING) AC_MSG_RESULT($PROFILING)
if test "x$PROFILING" = xyes; then if test "$PROFILING" = yes; then
COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage" COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
AC_PATH_PROG(LCOV, lcov) AC_PATH_TOOL(LCOV, lcov)
AC_PATH_PROG(GENHTML, genhtml) AC_PATH_TOOL(GENHTML, genhtml)
if test -z "$LCOV" -o -z "$GENHTML"; then test -z "$LCOV" -o -z "$GENHTML" && AC_MSG_ERROR([lcov and genhtml are required for profiling])
AC_MSG_ERROR([lcov and genhtml are required for profiling]) AC_PATH_TOOL(GENPNG, genpng)
fi
AC_PATH_PROG(GENPNG, genpng)
if test -n "$GENPNG"; then if test -n "$GENPNG"; then
AC_MSG_CHECKING([whether $GENPNG has all required modules]) AC_MSG_CHECKING([whether $GENPNG has all required modules])
if $GENPNG --help > /dev/null 2>&1 ; then if "$GENPNG" --help > /dev/null 2>&1 ; then
AC_MSG_RESULT(ok) AC_MSG_RESULT(ok)
GENHTML="$GENHTML --frames" GENHTML="$GENHTML --frames"
else else
AC_MSG_RESULT(not supported) AC_MSG_RESULT([not supported])
AC_MSG_WARN([GD.pm perl module is not installed]) AC_MSG_WARN([GD.pm perl module is not installed])
GENPNG= GENPNG=
fi fi
@ -966,14 +911,13 @@ fi
dnl -- Enable testing dnl -- Enable testing
AC_MSG_CHECKING(whether to enable unit testing) AC_MSG_CHECKING(whether to enable unit testing)
AC_ARG_ENABLE(testing, AC_ARG_ENABLE(testing,
AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]), AC_HELP_STRING([--enable-testing],
TESTING=$enableval, TESTING=no) [enable testing targets in the makefile]),
TESTING=$enableval, TESTING=no)
AC_MSG_RESULT($TESTING) AC_MSG_RESULT($TESTING)
if test "$TESTING" = yes; then if test "$TESTING" = yes; then
if test x$PKGCONFIG_INIT != x1; then pkg_config_init
pkg_config_init
fi
PKG_CHECK_MODULES(CUNIT, cunit >= 2.0) PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
fi fi
@ -981,15 +925,17 @@ fi
dnl -- Enable valgrind awareness of memory pools dnl -- Enable valgrind awareness of memory pools
AC_MSG_CHECKING(whether to enable valgrind awareness of pools) AC_MSG_CHECKING(whether to enable valgrind awareness of pools)
AC_ARG_ENABLE(valgrind_pool, AC_ARG_ENABLE(valgrind_pool,
AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]), AC_HELP_STRING([--enable-valgrind-pool],
[enable valgrind awareness of pools]),
VALGRIND_POOL=$enableval, VALGRIND_POOL=no) VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
AC_MSG_RESULT($VALGRIND_POOL) AC_MSG_RESULT($VALGRIND_POOL)
if test "$VALGRIND_POOL" = yes; then if test "$VALGRIND_POOL" = yes; then
PKG_CHECK_MODULES(VALGRIND, valgrind, [], [AC_MSG_ERROR(bailing out)]) pkg_config_init
AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool]) PKG_CHECK_MODULES(VALGRIND, valgrind, [], [AC_MSG_ERROR(bailing out)])
AC_SUBST(VALGRIND_POOL) AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
AC_SUBST(VALGRIND_CFLAGS) AC_SUBST(VALGRIND_POOL)
AC_SUBST(VALGRIND_CFLAGS)
fi fi
################################################################################ ################################################################################
@ -1001,7 +947,7 @@ AC_ARG_ENABLE(devmapper,
DEVMAPPER=$enableval) DEVMAPPER=$enableval)
AC_MSG_RESULT($DEVMAPPER) AC_MSG_RESULT($DEVMAPPER)
if test x$DEVMAPPER = xyes; then if test "$DEVMAPPER" = yes; then
AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.]) AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
fi fi
@ -1016,7 +962,7 @@ AC_MSG_RESULT($LVMETAD)
BUILD_LVMETAD=$LVMETAD BUILD_LVMETAD=$LVMETAD
if test x$BUILD_LVMETAD = xyes; then if test "$BUILD_LVMETAD" = yes; then
AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.]) AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
AC_ARG_WITH(lvmetad-pidfile, AC_ARG_WITH(lvmetad-pidfile,
@ -1037,22 +983,16 @@ AC_ARG_ENABLE(blkid_wiping,
BLKID_WIPING=$enableval, BLKID_WIPING=maybe) BLKID_WIPING=$enableval, BLKID_WIPING=maybe)
AC_MSG_RESULT($BLKID_WIPING) AC_MSG_RESULT($BLKID_WIPING)
if test x$BLKID_WIPING != xno; then if test "$BLKID_WIPING" != no; then
dnl -- init pkgconfig if required pkg_config_init
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
PKG_CHECK_MODULES(BLKID, blkid >= 2.24, PKG_CHECK_MODULES(BLKID, blkid >= 2.24,
[if test x$BLKID_WIPING = xmaybe; then [test "$BLKID_WIPING" = maybe && BLKID_WIPING=yes],
BLKID_WIPING=yes [if test "$BLKID_WIPING" = maybe; then
fi], BLKID_WIPING=no
[if test x$BLKID_WIPING = xmaybe; then else
BLKID_WIPING=no AC_MSG_ERROR([bailing out... blkid library >= 2.24 is required])
else fi])
AC_MSG_ERROR([bailing out... blkid library >= 2.24 is required]) if test "$BLKID_WIPING" = yes; then
fi
])
if test x$BLKID_WIPING = xyes; then
BLKID_PC="blkid" BLKID_PC="blkid"
AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.]) AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
fi fi
@ -1071,16 +1011,13 @@ AC_MSG_RESULT($UDEV_SYSTEMD_BACKGROUND_JOBS)
dnl -- Enable udev synchronisation dnl -- Enable udev synchronisation
AC_MSG_CHECKING(whether to enable synchronisation with udev processing) AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
AC_ARG_ENABLE(udev_sync, AC_ARG_ENABLE(udev_sync,
AC_HELP_STRING([--enable-udev_sync], AC_HELP_STRING([--enable-udev_sync],
[enable synchronisation with udev processing]), [enable synchronisation with udev processing]),
UDEV_SYNC=$enableval, UDEV_SYNC=no) UDEV_SYNC=$enableval, UDEV_SYNC=no)
AC_MSG_RESULT($UDEV_SYNC) AC_MSG_RESULT($UDEV_SYNC)
if test x$UDEV_SYNC = xyes; then if test "$UDEV_SYNC" = yes; then
dnl -- init pkgconfig if required pkg_config_init
if test x$PKGCONFIG_INIT != x1; then
pkg_config_init
fi
PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"]) PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.]) AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
fi fi
@ -1101,14 +1038,16 @@ AC_ARG_ENABLE(udev_rule_exec_detection,
AC_MSG_RESULT($UDEV_RULE_EXEC_DETECTION) AC_MSG_RESULT($UDEV_RULE_EXEC_DETECTION)
dnl -- Check support for built-in blkid against target udev version dnl -- Check support for built-in blkid against target udev version
AC_MSG_CHECKING(whether udev supports built-in blkid) if test "$UDEV_RULE" != no ; then
test x$PKGCONFIG_INIT != x1 && pkg_config_init AC_MSG_CHECKING(whether udev supports built-in blkid)
if $($PKG_CONFIG --atleast-version=176 libudev); then pkg_config_init
UDEV_HAS_BUILTIN_BLKID=yes if $("$PKG_CONFIG" --atleast-version=176 libudev); then
else UDEV_HAS_BUILTIN_BLKID=yes
UDEV_HAS_BUILTIN_BLKID=no else
UDEV_HAS_BUILTIN_BLKID=no
fi
AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
fi fi
AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
################################################################################ ################################################################################
dnl -- Compatibility mode dnl -- Compatibility mode
@ -1117,12 +1056,10 @@ AC_ARG_ENABLE(compat,
[enable support for old device-mapper versions]), [enable support for old device-mapper versions]),
DM_COMPAT=$enableval, DM_COMPAT=no) DM_COMPAT=$enableval, DM_COMPAT=no)
if test x$DM_COMPAT = xyes; then if test "$DM_COMPAT" = yes; then
AC_MSG_ERROR( AC_MSG_ERROR([--enable-compat is not currently supported.
[--enable-compat is not currently supported. Since device-mapper version 1.02.66, only one version (4) of the device-mapper
Since device-mapper version 1.02.66, only one version (4) of the device-mapper ioctl protocol is supported.])
ioctl protocol is supported.]
)
fi fi
################################################################################ ################################################################################
@ -1133,7 +1070,7 @@ AC_ARG_ENABLE(units-compat,
that do not use KiB-style unit suffixes]), that do not use KiB-style unit suffixes]),
UNITS_COMPAT=$enableval, UNITS_COMPAT=no) UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
if test x$UNITS_COMPAT = xyes; then if test "$UNITS_COMPAT" = yes; then
AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.]) AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
fi fi
@ -1152,7 +1089,7 @@ AC_ARG_ENABLE(o_direct,
ODIRECT=$enableval) ODIRECT=$enableval)
AC_MSG_RESULT($ODIRECT) AC_MSG_RESULT($ODIRECT)
if test x$ODIRECT = xyes; then if test "$ODIRECT" = yes; then
AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.]) AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
fi fi
@ -1164,7 +1101,7 @@ AC_ARG_ENABLE(applib,
APPLIB=$enableval, APPLIB=no) APPLIB=$enableval, APPLIB=no)
AC_MSG_RESULT($APPLIB) AC_MSG_RESULT($APPLIB)
AC_SUBST([LVM2APP_LIB]) AC_SUBST([LVM2APP_LIB])
test x$APPLIB = xyes \ test "$APPLIB" = yes \
&& LVM2APP_LIB=-llvm2app \ && LVM2APP_LIB=-llvm2app \
|| LVM2APP_LIB= || LVM2APP_LIB=
@ -1176,7 +1113,7 @@ AC_ARG_ENABLE(cmdlib,
CMDLIB=$enableval, CMDLIB=no) CMDLIB=$enableval, CMDLIB=no)
AC_MSG_RESULT($CMDLIB) AC_MSG_RESULT($CMDLIB)
AC_SUBST([LVM2CMD_LIB]) AC_SUBST([LVM2CMD_LIB])
test x$CMDLIB = xyes \ test "$CMDLIB" = yes \
&& LVM2CMD_LIB=-llvm2cmd \ && LVM2CMD_LIB=-llvm2cmd \
|| LVM2CMD_LIB= || LVM2CMD_LIB=
@ -1188,30 +1125,17 @@ AC_ARG_ENABLE(python_bindings,
PYTHON_BINDINGS=$enableval, PYTHON_BINDINGS=no) PYTHON_BINDINGS=$enableval, PYTHON_BINDINGS=no)
AC_MSG_RESULT($PYTHON_BINDINGS) AC_MSG_RESULT($PYTHON_BINDINGS)
if test x$PYTHON_BINDINGS = xyes; then if test "$PYTHON_BINDINGS" = yes; then
if test x$APPLIB != xyes; then test "$APPLIB" != yes && AC_MSG_ERROR([--enable-python_bindings requires --enable-applib])
AC_MSG_ERROR(
--enable-python_bindings requires --enable-applib
)
fi
AC_PATH_PROG(PYTHON, python, notfound) AC_PATH_TOOL(PYTHON, python)
if test x$PYTHON == xnotfound; then test -z "$PYTHON" && AC_MSG_ERROR([python is required for --enable-python_bindings but cannot be found])
AC_MSG_ERROR(
[python is required for --enable-python_bindings but cannot be found]
)
fi
AC_PATH_PROG(PYTHON_CONFIG, python-config, notfound) AC_PATH_TOOL(PYTHON_CONFIG, python-config)
if test x$PYTHON_CONFIG == xnotfound; then test -z "$PYTHON_CONFIG" && AC_MSG_ERROR([python headers are required for --enable-python_bindings but cannot be found])
AC_MSG_ERROR(
[python headers are required for --enable-python_bindings but cannot be found]
)
fi
PYTHON_INCDIRS=`$PYTHON_CONFIG --includes`
PYTHON_LIBDIRS=`$PYTHON_CONFIG --libs`
PYTHON_INCDIRS=`"$PYTHON_CONFIG" --includes`
PYTHON_LIBDIRS=`"$PYTHON_CONFIG" --libs`
fi fi
################################################################################ ################################################################################
@ -1252,21 +1176,15 @@ AC_MSG_RESULT($DMEVENTD)
BUILD_DMEVENTD=$DMEVENTD BUILD_DMEVENTD=$DMEVENTD
dnl -- dmeventd currently requires internal mirror support dnl -- dmeventd currently requires internal mirror support
if test x$DMEVENTD = xyes; then if test "$DMEVENTD" = yes; then
if test x$MIRRORS != xinternal; then if test "$MIRRORS" != internal; then
AC_MSG_ERROR( AC_MSG_ERROR([--enable-dmeventd currently requires --with-mirrors=internal])
--enable-dmeventd currently requires --with-mirrors=internal
)
fi fi
if test x$CMDLIB = xno; then if test "$CMDLIB" = no; then
AC_MSG_ERROR( AC_MSG_ERROR([--enable-dmeventd requires --enable-cmdlib to be used as well])
--enable-dmeventd requires --enable-cmdlib to be used as well
)
fi fi
fi
if test x$DMEVENTD = xyes; then AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
fi fi
################################################################################ ################################################################################
@ -1284,29 +1202,24 @@ AC_CHECK_LIB(c, canonicalize_file_name,
################################################################################ ################################################################################
dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; test "$exec_prefix" = NONE -a "$prefix" = NONE && exec_prefix=""
then exec_prefix="";
fi;
################################################################################ ################################################################################
dnl -- Check for dlopen dnl -- Check for dlopen
AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_LIB(dl, dlopen,
AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.]) [AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
DL_LIBS="-ldl" DL_LIBS="-ldl"
HAVE_LIBDL=yes ], [ HAVE_LIBDL=yes],
DL_LIBS= [DL_LIBS=
HAVE_LIBDL=no ]) HAVE_LIBDL=no ])
################################################################################ ################################################################################
dnl -- Check for shared/static conflicts dnl -- Check for shared/static conflicts
if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ if [[ \( "$LVM1" = shared -o "$POOL" = shared -o "$CLUSTER" = shared \
-o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ -o "$SNAPSHOTS" = shared -o "$MIRRORS" = shared \
-o "x$RAID" = xshared \ -o "$RAID" = shared -o "$CACHE" = shared \
-o "x$CACHE" = xshared \ \) -a "$STATIC_LINK" = yes ]]; then
\) -a "x$STATIC_LINK" = xyes ]]; AC_MSG_ERROR([Features cannot be 'shared' when building statically])
then AC_MSG_ERROR(
Features cannot be 'shared' when building statically
)
fi fi
################################################################################ ################################################################################
@ -1323,7 +1236,7 @@ AC_MSG_RESULT($SELINUX)
################################################################################ ################################################################################
dnl -- Check for selinux dnl -- Check for selinux
if test x$SELINUX = xyes; then if test "$SELINUX" = yes; then
AC_CHECK_LIB([sepol], [sepol_check_context], [ AC_CHECK_LIB([sepol], [sepol_check_context], [
AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.]) AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
SELINUX_LIBS="-lsepol"]) SELINUX_LIBS="-lsepol"])
@ -1343,10 +1256,10 @@ fi
################################################################################ ################################################################################
dnl -- Check for realtime clock support dnl -- Check for realtime clock support
if test x$REALTIME = xyes; then if test "$REALTIME" = yes; then
AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no) AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
if test x$HAVE_REALTIME = xyes; then if test "$HAVE_REALTIME" = yes; then
AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.]) AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
LIBS="-lrt $LIBS" LIBS="-lrt $LIBS"
else else
@ -1409,15 +1322,13 @@ AC_ARG_ENABLE(nls,
INTL=$enableval, INTL=no) INTL=$enableval, INTL=no)
AC_MSG_RESULT($INTL) AC_MSG_RESULT($INTL)
if test x$INTL = xyes; then if test "$INTL" = yes; then
# FIXME - Move this - can be device-mapper too # FIXME - Move this - can be device-mapper too
INTL_PACKAGE="lvm2" INTL_PACKAGE="lvm2"
AC_PATH_PROG(MSGFMT, msgfmt) AC_PATH_TOOL(MSGFMT, msgfmt)
if [[ "x$MSGFMT" == x ]]; if [[ -z "$MSGFMT" ]]; then
then AC_MSG_ERROR( AC_MSG_ERROR([msgfmt not found in path $PATH])
msgfmt not found in path $PATH fi
)
fi;
AC_ARG_WITH(localedir, AC_ARG_WITH(localedir,
AC_HELP_STRING([--with-localedir=DIR], AC_HELP_STRING([--with-localedir=DIR],
@ -1466,22 +1377,15 @@ AC_ARG_WITH(systemdsystemunitdir,
AC_HELP_STRING([--with-systemdsystemunitdir=DIR], AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
[systemd service files in DIR]), [systemd service files in DIR]),
systemdsystemunitdir=$withval, systemdsystemunitdir=$withval,
dnl -- init pkgconfig if required pkg_config_init
test x$PKGCONFIG_INIT != x1 && pkg_config_init pkg_systemdsystemunitdir=$("$PKG_CONFIG" --variable=systemdsystemunitdir systemd))
pkg_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd))
if test -n "$pkg_systemdsystemunitdir"; then test -n "$pkg_systemdsystemunitdir" && systemdsystemunitdir=$pkg_systemdsystemunitdir
systemdsystemunitdir=$pkg_systemdsystemunitdir; test -z "$systemdsystemunitdir" && systemdsystemunitdir='${exec_prefix}/lib/systemd/system';
fi
if test -z "$systemdsystemunitdir"; then systemdutildir=$("$PKG_CONFIG" --variable=systemdutildir systemd)
systemdsystemunitdir='${exec_prefix}/lib/systemd/system'; test -z "$systemdutildir" && systemdutildir='${exec_prefix}/lib/systemd';
fi
systemdutildir=$($PKG_CONFIG --variable=systemdutildir systemd)
if test -z "$systemdutildir"; then
systemdutildir='${exec_prefix}/lib/systemd';
fi
################################################################################ ################################################################################
AC_ARG_WITH(tmpfilesdir, AC_ARG_WITH(tmpfilesdir,
AC_HELP_STRING([--with-tmpfilesdir=DIR], AC_HELP_STRING([--with-tmpfilesdir=DIR],
@ -1489,42 +1393,42 @@ AC_ARG_WITH(tmpfilesdir,
tmpfilesdir=$withval, tmpfilesdir='${prefix}/lib/tmpfiles.d') tmpfilesdir=$withval, tmpfilesdir='${prefix}/lib/tmpfiles.d')
################################################################################ ################################################################################
dnl -- Ensure additional headers required dnl -- Ensure additional headers required
if test x$READLINE = xyes; then if test "$READLINE" = yes; then
AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out)) AC_CHECK_HEADERS(readline/readline.h readline/history.h,,hard_bailout)
fi fi
if test x$CLVMD != xnone; then if test "$CLVMD" != none; then
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_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_CHECK_FUNCS(dup2 getmntent memmove select socket,,hard_bailout)
AC_FUNC_GETMNTENT AC_FUNC_GETMNTENT
AC_FUNC_SELECT_ARGTYPES AC_FUNC_SELECT_ARGTYPES
fi fi
if test x$CLUSTER != xnone; then if test "$CLUSTER" != none; then
AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out)) AC_CHECK_HEADERS(sys/socket.h sys/un.h,,hard_bailout)
AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) AC_CHECK_FUNCS(socket,,hard_bailout)
fi fi
if test x$DMEVENTD = xyes; then if test "$DMEVENTD" = yes; then
AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out)) AC_CHECK_HEADERS(arpa/inet.h,,hard_bailout)
fi fi
if test x$HAVE_LIBDL = xyes; then if test "$HAVE_LIBDL" = yes; then
AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) AC_CHECK_HEADERS(dlfcn.h,,hard_bailout)
fi fi
if test x$INTL = xyes; then if test "$INTL" = yes; then
AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) AC_CHECK_HEADERS(libintl.h,,hard_bailout)
fi fi
if test x$UDEV_SYNC = xyes; then if test "$UDEV_SYNC" = yes; then
AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out)) AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,hard_bailout)
fi fi
################################################################################ ################################################################################
AC_PATH_PROG(MODPROBE_CMD, modprobe) AC_PATH_TOOL(MODPROBE_CMD, modprobe)
if test x$MODPROBE_CMD != x; then if test -n "$MODPROBE_CMD"; then
AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.]) AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
fi fi
@ -1536,9 +1440,9 @@ LVM_PATH="$lvm_exec_prefix/sbin/lvm"
AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.]) AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
if test "$CLVMD" != none; then if test "$CLVMD" != none; then
clvmd_prefix=$ac_default_prefix clvmd_prefix=$ac_default_prefix
CLVMD_PATH="$clvmd_prefix/sbin/clvmd" CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
test "$prefix" != NONE && clvmd_prefix=$prefix test "$prefix" != NONE && clvmd_prefix=$prefix
AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.]) AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
fi fi
@ -1625,10 +1529,7 @@ AC_ARG_WITH(interface,
AC_HELP_STRING([--with-interface=IFACE], AC_HELP_STRING([--with-interface=IFACE],
[choose kernel interface (ioctl) [[ioctl]]]), [choose kernel interface (ioctl) [[ioctl]]]),
interface=$withval, interface=ioctl) interface=$withval, interface=ioctl)
if [[ "x$interface" != xioctl ]]; test "$interface" != ioctl && AC_MSG_ERROR([--with-interface=ioctl required. fs no longer supported.])
then
AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
fi
AC_MSG_RESULT($interface) AC_MSG_RESULT($interface)
################################################################################ ################################################################################
@ -1859,8 +1760,6 @@ AC_OUTPUT
test -n "$THIN_CONFIGURE_WARN" && AC_MSG_WARN([Support for thin provisioning is limited since some thin provisioning tools are missing!]) test -n "$THIN_CONFIGURE_WARN" && AC_MSG_WARN([Support for thin provisioning is limited since some thin provisioning tools are missing!])
test -n "$THIN_CHECK_VERSION_WARN" && AC_MSG_WARN(You should also install thin_check vsn 0.3.2 (or later) to use lvm2 thin provisioning) test -n "$THIN_CHECK_VERSION_WARN" && AC_MSG_WARN([You should also install thin_check vsn 0.3.2 (or later) to use lvm2 thin provisioning])
if test x$ODIRECT != xyes; then test "$ODIRECT" != yes && AC_MSG_WARN([O_DIRECT disabled: low-memory pvmove may lock up])
AC_MSG_WARN(O_DIRECT disabled: low-memory pvmove may lock up)
fi