diff -durN -x '*~' device-mapper.1.01.03.orig/configure.in device-mapper.1.01.03/configure.in
--- device-mapper.1.01.03.orig/configure.in 2005-06-13 16:07:29.000000000 +0200
+++ device-mapper.1.01.03/configure.in 2005-07-31 19:10:30.000000000 +0200
-@@ -178,6 +178,8 @@
- dnl -- Enables staticly-linked tools
- 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_ARG_ENABLE(dynamic_link, [ --disable-dynamic_link Use this not to link the tools to their libraries
-+ statically. Default is dynamic linking], DYNAMIC_LINK=$enableval, DYNAMIC_LINK=yes)
-
- ################################################################################
- dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
-@@ -324,6 +326,7 @@
- ################################################################################
- AC_SUBST(JOBS)
+@@ -249,7 +249,15 @@
+ STATIC_LINK=$enableval, STATIC_LINK=no)
+ AC_MSG_RESULT($STATIC_LINK)
+
+-################################################################################
++#
++AC_MSG_CHECKING(whether to use dynamic linking)
++AC_ARG_ENABLE(dynamic_link,
++ [ --enable-dynamic_link Use this to not link the tools to their libraries
++ statically. Default is dynamic linking],
++ DYNAMIC_LINK=$enableval, DYNAMIC_LINK=no)
++AC_MSG_RESULT($DYNAMIC_LINK)
++
++###############################################################################
+ dnl -- Disable selinux
+ AC_MSG_CHECKING(whether to enable selinux support)
+ AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
+@@ -496,6 +496,7 @@
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
AC_SUBST(STATIC_LINK)
+AC_SUBST(DYNAMIC_LINK)
- AC_SUBST(OWNER)
- AC_SUBST(GROUP)
- AC_SUBST(LIBS)
+ AC_SUBST([LIB_PTHREAD])
+ AC_SUBST(interface)
+ AC_SUBST(kerneldir)
--- device-mapper.1.02.23/dmsetup/Makefile.in.orig 2007-08-21 22:32:30.000000000 +0200
+++ device-mapper.1.02.23/dmsetup/Makefile.in 2007-12-16 23:07:07.095562047 +0100
@@ -16,8 +16,10 @@
--- device-mapper.1.02.07/configure.in.orig 2006-05-17 19:23:21.778894500 +0200
+++ device-mapper.1.02.07/configure.in 2006-05-17 19:31:56.351053250 +0200
-@@ -209,7 +209,7 @@
+@@ -230,8 +230,8 @@
################################################################################
dnl -- getline included in recent libc
--AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1, [Define to 1 if getline is available.]))
-+AC_CHECK_FUNC(getline, [AC_DEFINE([HAVE_GETLINE], 1, [Define to 1 if getline is available.])])
+-AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
+- [Define to 1 if getline is available.]))
++AC_CHECK_FUNC(getline, [AC_DEFINE([HAVE_GETLINE], 1,
++ [Define to 1 if getline is available.])])
################################################################################
- dnl -- Disable selinux
+ dnl -- canonicalize_file_name included in recent libc
@@ -240,7 +240,7 @@
################################################################################
+--- device-mapper/configure.in~ 2008-07-06 19:22:49.965050005 +0200
++++ device-mapper/configure.in 2008-07-06 19:26:11.998363857 +0200
+@@ -107,7 +107,7 @@
+
+ ################################################################################
+ dnl -- Check for functions
+-AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
++AC_CHECK_FUNCS([gethostname memset mkdir rmdir munmap \
+ strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
+ uname], , [AC_MSG_ERROR(bailing out)])
+ AC_FUNC_ALLOCA
--- device-mapper.1.02.09.orig/configure.in 2006-09-27 18:22:22.000000000 +0000
+++ device-mapper.1.02.09.klibc/configure.in 2006-09-27 18:22:22.000000000 +0000
-@@ -69,7 +69,7 @@
- AC_HEADER_STDC
+@@ -87,7 +87,7 @@
+ AC_HEADER_SYS_WAIT
AC_HEADER_TIME
--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(ctype.h dirent.h errno.h fcntl.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)
- ################################################################################
+-AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
++AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.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)
--- device-mapper.1.02.09.orig/dmsetup/dmsetup.c 2006-08-10 20:53:21.000000000 +0000
+++ device-mapper.1.02.09.klibc/dmsetup/dmsetup.c 2006-09-27 18:22:58.000000000 +0000
@@ -31,12 +31,13 @@