mc-vfs.m4 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. AC_DEFUN([mc_VFS_ADDNAME],
  2. [
  3. if test x"$vfs_flags" = "x" ; then
  4. vfs_flags="$1"
  5. else
  6. vfs_flags="$vfs_flags, $1"
  7. fi
  8. ])
  9. m4_include([m4.include/vfs/socket.m4])
  10. m4_include([m4.include/vfs/mc-vfs-extfs.m4])
  11. m4_include([m4.include/vfs/mc-vfs-sfs.m4])
  12. m4_include([m4.include/vfs/mc-vfs-ftp.m4])
  13. m4_include([m4.include/vfs/mc-vfs-sftp.m4])
  14. m4_include([m4.include/vfs/mc-vfs-shell.m4])
  15. m4_include([m4.include/vfs/mc-vfs-undelfs.m4])
  16. m4_include([m4.include/vfs/mc-vfs-tarfs.m4])
  17. m4_include([m4.include/vfs/mc-vfs-cpiofs.m4])
  18. dnl mc_VFS_CHECKS
  19. dnl Check for various functions needed by libvfs.
  20. dnl This has various effects:
  21. dnl Sets MC_VFS_LIBS to libraries required
  22. dnl Sets vfs_flags to "pretty" list of vfs implementations we include.
  23. dnl Sets shell variable enable_vfs to yes (default, --with-vfs) or
  24. dnl "no" (--without-vfs).
  25. dnl Private define
  26. AC_DEFUN([mc_ENABLE_VFS_NET],
  27. [
  28. dnl FIXME: network checks should probably be in their own macro.
  29. AC_REQUIRE_SOCKET
  30. if test x"$have_socket" = xyes; then
  31. AC_CHECK_TYPE([nlink_t], ,
  32. [AC_DEFINE_UNQUOTED([nlink_t], [unsigned int],
  33. [Define to 'unsigned int' if <sys/types.h> does not define.])])
  34. AC_CHECK_TYPES([socklen_t],,,
  35. [
  36. #include <sys/types.h>
  37. #include <sys/socket.h>
  38. ])
  39. enable_vfs_net=yes
  40. AC_DEFINE(ENABLE_VFS_NET, [1], [Define to enable network VFSes support])
  41. fi
  42. ])
  43. AC_DEFUN([mc_VFS_CHECKS],
  44. [
  45. vfs_type="normal"
  46. AC_ARG_ENABLE([vfs],
  47. AS_HELP_STRING([--disable-vfs], [Disable VFS]),
  48. [
  49. if test "x$enableval" = "xno"; then
  50. enable_vfs=no
  51. else
  52. enable_vfs=yes
  53. fi
  54. ],
  55. [enable_vfs=yes])
  56. if test x"$enable_vfs" = x"yes" ; then
  57. vfs_type="Midnight Commander Virtual Filesystem"
  58. AC_MSG_NOTICE([Enabling VFS code])
  59. AC_DEFINE(ENABLE_VFS, [1], [Define to enable VFS support])
  60. fi
  61. mc_VFS_CPIOFS
  62. mc_VFS_EXTFS
  63. mc_VFS_SHELL
  64. mc_VFS_FTP
  65. mc_VFS_SFS
  66. mc_VFS_SFTP
  67. mc_VFS_TARFS
  68. mc_VFS_UNDELFS
  69. AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])
  70. if test x"$enable_vfs_ftp" = x"yes" -o x"$enable_vfs_shell" = x"yes" -o x"$enable_vfs_sftp" = x"yes"; then
  71. mc_ENABLE_VFS_NET
  72. fi
  73. AM_CONDITIONAL([ENABLE_VFS_NET], [test x"$enable_vfs_net" = x"yes"])
  74. ])