mc-vfs.m4 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. AC_DEFUN([AC_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/rpc.m4])
  10. m4_include([m4.include/vfs/socket.m4])
  11. m4_include([m4.include/vfs/mc-vfs-extfs.m4])
  12. m4_include([m4.include/vfs/mc-vfs-sfs.m4])
  13. m4_include([m4.include/vfs/mc-vfs-ftp.m4])
  14. m4_include([m4.include/vfs/mc-vfs-fish.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. m4_include([m4.include/vfs/mc-vfs-mcfs.m4])
  19. m4_include([m4.include/vfs/mc-vfs-samba.m4])
  20. m4_include([m4.include/vfs/mc-mvfs.m4])
  21. dnl MC_VFS_CHECKS
  22. dnl Check for various functions needed by libvfs.
  23. dnl This has various effects:
  24. dnl Sets MC_VFS_LIBS to libraries required
  25. dnl Sets vfs_flags to "pretty" list of vfs implementations we include.
  26. dnl Sets shell variable enable_vfs to yes (default, --with-vfs) or
  27. dnl "no" (--without-vfs).
  28. dnl Private define
  29. AC_DEFUN([MC_WITH_VFS],
  30. [
  31. use_net_code=false
  32. AC_ARG_ENABLE([netcode],
  33. [ --enable-netcode Support for networking [[yes]]])
  34. if test "x$enable_netcode" != xno; then
  35. dnl FIXME: network checks should probably be in their own macro.
  36. AC_SEARCH_LIBS(socket, [xnet bsd socket inet], [have_socket=yes])
  37. if test x"$have_socket" = xyes; then
  38. AC_SEARCH_LIBS(gethostbyname, [bsd socket inet netinet])
  39. AC_CHECK_MEMBERS([struct linger.l_linger], , , [
  40. #include <sys/types.h>
  41. #include <sys/socket.h>
  42. ])
  43. AC_CHECK_RPC
  44. AC_REQUIRE_SOCKET
  45. MC_MCSERVER_CHECKS
  46. use_net_code=true
  47. fi
  48. fi
  49. AC_DEFINE(ENABLE_VFS, 1, [Define to enable VFS support])
  50. if $use_net_code; then
  51. AC_DEFINE(USE_NETCODE, 1, [Define to use networked VFS])
  52. fi
  53. ])
  54. AC_DEFUN([AC_MC_VFS_CHECKS],[
  55. AC_ARG_ENABLE([vfs],
  56. [ --disable-vfs Disable VFS])
  57. if test x"$enable_vfs" != x"no" ; then
  58. enable_vfs="yes"
  59. vfs_type="Midnight Commander Virtual Filesystem"
  60. AC_MSG_NOTICE([Enabling VFS code])
  61. AC_MC_VFS_CPIOFS
  62. AC_MC_VFS_TARFS
  63. AC_MC_VFS_FTP
  64. AC_MC_VFS_FISH
  65. AC_MC_VFS_EXTFS
  66. AC_MC_VFS_SFS
  67. AC_MC_VFS_UNDELFS
  68. AC_MC_VFS_MCFS
  69. AC_MC_VFS_SAMBA
  70. MC_WITH_VFS
  71. else
  72. vfs_type="Plain OS filesystem"
  73. AM_CONDITIONAL(ENABLE_VFS_CPIO, [false])
  74. AM_CONDITIONAL(ENABLE_VFS_TAR, [false])
  75. AM_CONDITIONAL(ENABLE_VFS_FTP, [false])
  76. AM_CONDITIONAL(ENABLE_VFS_FISH, [false])
  77. AM_CONDITIONAL(ENABLE_VFS_EXTFS, [false])
  78. AM_CONDITIONAL(ENABLE_VFS_SFS, [false])
  79. AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [false])
  80. fi
  81. AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])
  82. ])