Commit 39d5fd28 authored by Milan Broz's avatar Milan Broz

Try to use pkdconfig for devmapper.

Disable udev automatically if devmapper doesn't support it.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@203 36d66b0a-2a48-0410-832c-cd162a569da5
parent 0516a1a6
......@@ -78,20 +78,28 @@ AC_ARG_ENABLE(selinux,
AC_ARG_ENABLE([udev],AS_HELP_STRING([--disable-udev],[disable udev support]),[], enable_udev=yes)
dnl Try to use pkg-config for devmapper, but fallback to old detection
saved_LIBS=$LIBS
AC_CHECK_LIB(devmapper, dm_task_set_name,,[AC_MSG_ERROR('You need the device-mapper library')])
AC_CHECK_LIB(devmapper, dm_task_set_message,,
[AC_MSG_ERROR([The device-mapper library on your system is too old.])])
if AC_RUN_LOG([pkg-config --exists --print-errors devmapper]); then
PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= 1.02.03])
LIBS="$LIBS $DEVMAPPER_LIBS"
else
AC_CHECK_LIB(devmapper, dm_task_set_name,,
[AC_MSG_ERROR('You need the device-mapper library')])
AC_CHECK_LIB(devmapper, dm_task_set_message,,
[AC_MSG_ERROR([The device-mapper library on your system is too old.])])
DEVMAPPER_LIBS=$LIBS
fi
AC_CHECK_FUNCS([dm_task_set_cookie], [have_cookie=yes], [have_cookie=no])
if test "x$enable_udev" = xyes; then
if test "x$have_cookie" = xno; then
AC_MSG_ERROR([The device-mapper library on your system has no udev support, consider --disable-udev.])
AC_MSG_WARN([The device-mapper library on your system has no udev support, udev support disabled.])
else
AC_DEFINE(USE_UDEV, 1, [Try to use udev synchronisation?])
fi
AC_DEFINE(USE_UDEV, 1, [Try to use udev synchronisation?])
fi
DEVMAPPER_LIBS=$LIBS
LIBS=$saved_LIBS
if test "x$enable_selinux" != xno; then
AC_CHECK_LIB(sepol, sepol_bool_set)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment