mc-vfs-undelfs.m4 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. dnl mc_UNDELFS_CHECKS
  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.
  6. AC_DEFUN([mc_UNDELFS_CHECKS], [
  7. ext2fs_undel=no
  8. EXT2FS_UNDEL_LIBS=
  9. dnl Use result of mc_EXT2FS_ATTR that was called earlier
  10. if test "x$ext2fs_attr_msg" = "xyes"; then
  11. com_err=no
  12. PKG_CHECK_MODULES(COM_ERR, [com_err >= 1.42.4], [com_err=yes], [:])
  13. if test x"$com_err" = "xyes"; then
  14. EXT2FS_UNDEL_LIBS="$EXT2FS_LIBS $COM_ERR_LIBS"
  15. ext2fs_undel=yes
  16. fi
  17. fi
  18. ])
  19. dnl
  20. dnl Ext2fs undelete support
  21. dnl
  22. AC_DEFUN([mc_VFS_UNDELFS],
  23. [
  24. AC_ARG_ENABLE([vfs-undelfs],
  25. AS_HELP_STRING([--enable-vfs-undelfs], [Support for ext2 undelete filesystem @<:@no@:>@]),
  26. [
  27. if test "x$enableval" = "xno"; then
  28. enable_vfs_undelfs=no
  29. else
  30. enable_vfs_undelfs=yes
  31. fi
  32. ],
  33. [enable_vfs_undelfs="no"])
  34. if test x"$enable_vfs" = x"yes" -a x"$enable_vfs_undelfs" != x"no"; then
  35. mc_UNDELFS_CHECKS
  36. if test x"$ext2fs_undel" = x"yes"; then
  37. enable_vfs_undelfs="yes"
  38. mc_VFS_ADDNAME([undelfs])
  39. AC_DEFINE(ENABLE_VFS_UNDELFS, [1], [Support for ext2 undelfs])
  40. AC_MSG_NOTICE([using ext2fs file recovery code])
  41. MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
  42. else
  43. AC_MSG_ERROR([Ext2 libraries not found])
  44. fi
  45. fi
  46. AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [test "$enable_vfs" = "yes" -a x"$enable_vfs_undelfs" = x"yes"])
  47. ])