updated
[platform/upstream/cryptsetup.git] / configure.in
index e7011ee..936d165 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ(2.57)
-AC_INIT(cryptsetup,1.1.0)
+AC_INIT(cryptsetup,1.1.3)
 
 dnl library version from <major>.<minor>.<release>[-<suffix>]
 LIBCRYPTSETUP_VERSION=$(echo $PACKAGE_VERSION | cut -f1 -d-)
@@ -78,20 +78,32 @@ 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_PROG_PKG_CONFIG
+       if test x$enable_static = xyes; then
+               PKG_CONFIG="$PKG_CONFIG --static"
+       fi
+       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])
+AC_CHECK_DECLS([DM_UDEV_DISABLE_DISK_RULES_FLAG], [have_cookie=yes], [have_cookie=no], [#include <libdevmapper.h>])
 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)