]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: extend fiemap configure check
authorNathan Scott <nathans@debian.org>
Tue, 31 Jan 2012 23:11:16 +0000 (10:11 +1100)
committerChristoph Hellwig <hch@lst.de>
Sun, 5 Feb 2012 14:00:34 +0000 (14:00 +0000)
Make the fiemap configure check consistent with the other
libc interface checks - perform a compile and link with a
complete set of symbols, macros and interfaces needed, as
opposed to a build with just the headers.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Nathan Scott <nathans@debian.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
m4/package_libcdev.m4

index 8192181a504acd2f3d5f76327d4dcf6282c91b9f..1e2c256b30c8921d01f6b655e4083c78e7315d78 100644 (file)
@@ -121,6 +121,17 @@ AC_DEFUN([AC_HAVE_FALLOCATE],
 # Check if we have the fiemap ioctl (Linux)
 #
 AC_DEFUN([AC_HAVE_FIEMAP],
-  [ AC_CHECK_HEADERS([linux/fiemap.h], [ have_fiemap=yes ], [ have_fiemap=no ])
+  [ AC_MSG_CHECKING([for fiemap])
+    AC_TRY_LINK([
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+#include <linux/fs.h>
+#include <linux/fiemap.h>
+    ], [
+         struct fiemap *fiemap;
+         ioctl(0, FS_IOC_FIEMAP, (unsigned long)fiemap);
+    ], have_fiemap=yes
+       AC_MSG_RESULT(yes),
+       AC_MSG_RESULT(no))
     AC_SUBST(have_fiemap)
   ])