2016-01-04 21:43:19 +03:00
|
|
|
dnl mc_UNDELFS_CHECKS
|
2009-05-07 16:38:06 +04:00
|
|
|
dnl Check for ext2fs undel support.
|
|
|
|
dnl Set shell variable ext2fs_undel to "yes" if we have it,
|
2010-07-10 20:03:38 +04:00
|
|
|
dnl "no" otherwise. May define ENABLE_VFS_UNDELFS for cpp.
|
2009-05-07 16:38:06 +04:00
|
|
|
dnl Will set EXT2FS_UNDEL_LIBS to required libraries.
|
|
|
|
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_UNDELFS_CHECKS], [
|
2009-05-07 16:38:06 +04:00
|
|
|
ext2fs_undel=no
|
|
|
|
EXT2FS_UNDEL_LIBS=
|
|
|
|
AC_CHECK_HEADERS([ext2fs/ext2_fs.h linux/ext2_fs.h], [ext2_fs_h=yes; break])
|
2009-07-26 17:11:53 +04:00
|
|
|
if test x"$ext2_fs_h" = xyes; then
|
2009-05-07 16:38:06 +04:00
|
|
|
AC_CHECK_HEADERS([ext2fs/ext2fs.h], [ext2fs_ext2fs_h=yes], ,
|
|
|
|
[
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef HAVE_EXT2FS_EXT2_FS_H
|
|
|
|
#include <ext2fs/ext2_fs.h>
|
|
|
|
#else
|
|
|
|
#undef umode_t
|
|
|
|
#include <linux/ext2_fs.h>
|
|
|
|
#endif
|
|
|
|
])
|
2009-07-26 17:11:53 +04:00
|
|
|
if test x"$ext2fs_ext2fs_h" = xyes; then
|
2009-05-07 16:38:06 +04:00
|
|
|
ext2fs_undel=yes
|
|
|
|
EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
|
2011-05-25 18:19:39 +04:00
|
|
|
AC_CHECK_TYPE([ext2_ino_t], ,
|
|
|
|
[AC_DEFINE_UNQUOTED([ext2_ino_t], [ino_t],
|
2009-05-07 16:38:06 +04:00
|
|
|
[Define to ino_t if undefined.])],
|
|
|
|
[
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#ifdef HAVE_EXT2FS_EXT2_FS_H
|
|
|
|
#include <ext2fs/ext2_fs.h>
|
|
|
|
#else
|
|
|
|
#undef umode_t
|
|
|
|
#include <linux/ext2_fs.h>
|
|
|
|
#endif
|
|
|
|
#include <ext2fs/ext2fs.h>
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Ext2fs undelete support
|
|
|
|
dnl
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_VFS_UNDELFS],
|
2009-05-07 16:38:06 +04:00
|
|
|
[
|
2010-07-10 20:03:38 +04:00
|
|
|
AC_ARG_ENABLE([vfs-undelfs],
|
2011-05-25 17:51:18 +04:00
|
|
|
AS_HELP_STRING([--enable-vfs-undelfs], [Support for ext2 undelete filesystem @<:@no@:>@]),
|
2010-07-23 11:38:20 +04:00
|
|
|
[
|
|
|
|
if test "x$enableval" = "xno"; then
|
|
|
|
enable_vfs_undelfs=no
|
|
|
|
else
|
|
|
|
enable_vfs_undelfs=yes
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
[enable_vfs_undelfs="no"])
|
2009-05-07 16:38:06 +04:00
|
|
|
|
2010-07-24 11:24:07 +04:00
|
|
|
if test x"$enable_vfs" = x"yes" -a x"$enable_vfs_undelfs" != x"no"; then
|
2016-01-04 21:43:19 +03:00
|
|
|
mc_UNDELFS_CHECKS
|
2009-05-07 16:38:06 +04:00
|
|
|
|
2010-07-10 20:03:38 +04:00
|
|
|
if test x"$ext2fs_undel" = x"yes"; then
|
2009-05-07 16:38:06 +04:00
|
|
|
enable_vfs_undelfs="yes"
|
2016-01-04 21:43:19 +03:00
|
|
|
mc_VFS_ADDNAME([undelfs])
|
2009-05-07 16:38:06 +04:00
|
|
|
AC_DEFINE(ENABLE_VFS_UNDELFS, [1], [Support for ext2 undelfs])
|
|
|
|
AC_MSG_NOTICE([using ext2fs file recovery code])
|
|
|
|
MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
|
|
|
|
else
|
|
|
|
AC_ERROR([Ext2 libraries not found])
|
|
|
|
fi
|
|
|
|
fi
|
2010-07-24 11:24:07 +04:00
|
|
|
AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [test "$enable_vfs" = "yes" -a x"$enable_vfs_undelfs" = x"yes"])
|
2009-05-07 16:38:06 +04:00
|
|
|
])
|