Skip to contentSkip to conversation

xfsprogs: extend fiemap configure check

PATCH In review Nathan Scott 3 participants 3 messages Jan 31, 2012 – Feb 2, 2012 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 xfsprogs: extend fiemap configure check

In reply to a message not in the archive

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.

m4/package_libcdev.m4 +12 -1
index 8192181..1e2c256 100644
@@ -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)
   ])

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#2 lore raw
Quoted 6 lines · Nathan Scott

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.

Looks good,

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#3 lore raw
In reply to Nathan Scott
Quoted 6 lines · Nathan Scott

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.

Definitely a good idea.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs