2 dnl Check for ext2fs undel support.
3 dnl Set shell variable ext2fs_undel to "yes" if we have it,
4 dnl "no" otherwise. May define ENABLE_VFS_UNDELFS for cpp.
5 dnl Will set EXT2FS_UNDEL_LIBS to required libraries.
7 AC_DEFUN([MC_UNDELFS_CHECKS], [
10 AC_CHECK_HEADERS([ext2fs/ext2_fs.h linux/ext2_fs.h], [ext2_fs_h=yes; break])
11 if test x"$ext2_fs_h" = xyes; then
12 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [ext2fs_ext2fs_h=yes], ,
15 #ifdef HAVE_EXT2FS_EXT2_FS_H
16 #include <ext2fs/ext2_fs.h>
19 #include <linux/ext2_fs.h>
22 if test x"$ext2fs_ext2fs_h" = xyes; then
24 EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
25 AC_CHECK_TYPE([ext2_ino_t], ,
26 [AC_DEFINE_UNQUOTED([ext2_ino_t], [ino_t],
27 [Define to ino_t if undefined.])],
33 #ifdef HAVE_EXT2FS_EXT2_FS_H
34 #include <ext2fs/ext2_fs.h>
37 #include <linux/ext2_fs.h>
39 #include <ext2fs/ext2fs.h>
46 dnl Ext2fs undelete support
48 AC_DEFUN([AC_MC_VFS_UNDELFS],
50 AC_ARG_ENABLE([vfs-undelfs],
51 AS_HELP_STRING([--enable-vfs-undelfs], [Support for ext2 undelete filesystem @<:@no@:>@]),
53 if test "x$enableval" = "xno"; then
56 enable_vfs_undelfs=yes
59 [enable_vfs_undelfs="no"])
61 if test x"$enable_vfs" = x"yes" -a x"$enable_vfs_undelfs" != x"no"; then
64 if test x"$ext2fs_undel" = x"yes"; then
65 enable_vfs_undelfs="yes"
66 AC_MC_VFS_ADDNAME([undelfs])
67 AC_DEFINE(ENABLE_VFS_UNDELFS, [1], [Support for ext2 undelfs])
68 AC_MSG_NOTICE([using ext2fs file recovery code])
69 MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
71 AC_ERROR([Ext2 libraries not found])
74 AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [test "$enable_vfs" = "yes" -a x"$enable_vfs_undelfs" = x"yes"])