summaryrefslogtreecommitdiffstats
path: root/config/user-libblkid.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/user-libblkid.m4')
-rw-r--r--config/user-libblkid.m433
1 files changed, 26 insertions, 7 deletions
diff --git a/config/user-libblkid.m4 b/config/user-libblkid.m4
index 276587fd3..2dd26238c 100644
--- a/config/user-libblkid.m4
+++ b/config/user-libblkid.m4
@@ -22,26 +22,45 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
[with_blkid=check])
LIBBLKID=
- AS_IF([test "x$with_blkid" != xno],
+ AS_IF([test "x$with_blkid" = xyes],
+ [
+ AC_SUBST([LIBBLKID], ["-lblkid"])
+ AC_DEFINE([HAVE_LIBBLKID], 1,
+ [Define if you have libblkid])
+ ])
+
+ AS_IF([test "x$with_blkid" = xcheck],
[
AC_CHECK_LIB([blkid], [blkid_get_cache],
[
AC_MSG_CHECKING([for blkid zfs support])
ZFS_DEV=`mktemp`
- dd if=/dev/zero of=$ZFS_DEV bs=1024k count=8 \
+ truncate -s 64M $ZFS_DEV
+ echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+ dd of=$ZFS_DEV bs=1k count=8 \
+ seek=128 conv=notrunc &>/dev/null \
>/dev/null 2>/dev/null
echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
dd of=$ZFS_DEV bs=1k count=8 \
seek=132 conv=notrunc &>/dev/null \
>/dev/null 2>/dev/null
+ echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+ dd of=$ZFS_DEV bs=1k count=8 \
+ seek=136 conv=notrunc &>/dev/null \
+ >/dev/null 2>/dev/null
+ echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+ dd of=$ZFS_DEV bs=1k count=8 \
+ seek=140 conv=notrunc &>/dev/null \
+ >/dev/null 2>/dev/null
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="-lblkid"
+ saved_LIBS="$LIBS"
+ LIBS="-lblkid"
AC_RUN_IFELSE([AC_LANG_PROGRAM(
[
#include <stdio.h>
+ #include <stdlib.h>
#include <blkid/blkid.h>
],
[
@@ -58,10 +77,10 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
return 2;
}
- if (strcmp(value, "zfs")) {
+ if (strcmp(value, "zfs_member")) {
free(value);
blkid_put_cache(cache);
- return 3;
+ return 0;
}
free(value);
@@ -82,7 +101,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
[--with-blkid given but unavailable])])
])
- LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
],
[
AS_IF([test "x$with_blkid" != xcheck],