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 USE_EXT2FSLIB 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
23 AC_DEFINE(USE_EXT2FSLIB, 1,
24 [Define to enable undelete support on ext2])
26 EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
27 AC_CHECK_TYPE(ext2_ino_t, ,
28 [AC_DEFINE(ext2_ino_t, ino_t,
29 [Define to ino_t if undefined.])],
35 #ifdef HAVE_EXT2FS_EXT2_FS_H
36 #include <ext2fs/ext2_fs.h>
39 #include <linux/ext2_fs.h>
41 #include <ext2fs/ext2fs.h>
48 dnl Ext2fs undelete support
50 AC_DEFUN([AC_MC_VFS_UNDELFS],
52 AC_ARG_ENABLE([undelfs],
53 [ --enable-vfs-undelfs Support for ext2 undelete filesystem])
55 if test x"$enable_vfs_undelfs" = x"yes" ; then
59 if test x"$ext2fs_undel" = xyes; then
60 enable_vfs_undelfs="yes"
61 AC_MC_VFS_ADDNAME([undelfs])
62 AC_DEFINE(ENABLE_VFS_UNDELFS, [1], [Support for ext2 undelfs])
63 AC_MSG_NOTICE([using ext2fs file recovery code])
64 MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
66 AC_ERROR([Ext2 libraries not found])
69 AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [test x"$enable_vfs_undelfs" = x"yes"])