mc-vfs-undelfs.m4 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 USE_EXT2FSLIB 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. AC_CHECK_HEADERS([ext2fs/ext2_fs.h linux/ext2_fs.h], [ext2_fs_h=yes; break])
  10. if test x"$ext2_fs_h" = xyes; then
  11. AC_CHECK_HEADERS([ext2fs/ext2fs.h], [ext2fs_ext2fs_h=yes], ,
  12. [
  13. #include <stdio.h>
  14. #ifdef HAVE_EXT2FS_EXT2_FS_H
  15. #include <ext2fs/ext2_fs.h>
  16. #else
  17. #undef umode_t
  18. #include <linux/ext2_fs.h>
  19. #endif
  20. ])
  21. if test x"$ext2fs_ext2fs_h" = xyes; then
  22. AC_DEFINE(USE_EXT2FSLIB, 1,
  23. [Define to enable undelete support on ext2])
  24. ext2fs_undel=yes
  25. EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
  26. AC_CHECK_TYPE(ext2_ino_t, ,
  27. [AC_DEFINE(ext2_ino_t, ino_t,
  28. [Define to ino_t if undefined.])],
  29. [
  30. #include <errno.h>
  31. #include <stdio.h>
  32. #include <fcntl.h>
  33. #include <stdlib.h>
  34. #ifdef HAVE_EXT2FS_EXT2_FS_H
  35. #include <ext2fs/ext2_fs.h>
  36. #else
  37. #undef umode_t
  38. #include <linux/ext2_fs.h>
  39. #endif
  40. #include <ext2fs/ext2fs.h>
  41. ])
  42. fi
  43. fi
  44. ])
  45. dnl
  46. dnl Ext2fs undelete support
  47. dnl
  48. AC_DEFUN([AC_MC_VFS_UNDELFS],
  49. [
  50. AC_ARG_ENABLE([undelfs],
  51. [ --enable-vfs-undelfs Support for ext2 undelete filesystem])
  52. if test x"$enable_vfs_undelfs" = x"yes" ; then
  53. MC_UNDELFS_CHECKS
  54. if test x"$ext2fs_undel" = xyes; then
  55. enable_vfs_undelfs="yes"
  56. AC_MC_VFS_ADDNAME([undelfs])
  57. AC_DEFINE(ENABLE_VFS_UNDELFS, [1], [Support for ext2 undelfs])
  58. AC_MSG_NOTICE([using ext2fs file recovery code])
  59. MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
  60. else
  61. AC_ERROR([Ext2 libraries not found])
  62. fi
  63. fi
  64. AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [test x"$enable_vfs_undelfs" = x"yes"])
  65. ])