mc-vfs.m4 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 use_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(USE_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 Compile with VFS code])
  57. if test x"$enable_vfs" != x"no" ; then
  58. enable_vfs="yes"
  59. vfs_type="Midnight Commander Virtual Filesystem"
  60. use_vfs=yes
  61. AC_MSG_NOTICE([Enabling VFS code])
  62. AC_MC_MVFS_FILESYSTEMS
  63. AC_MC_VFS_CPIOFS
  64. AC_MC_VFS_TARFS
  65. AC_MC_VFS_FTP
  66. AC_MC_VFS_FISH
  67. AC_MC_VFS_EXTFS
  68. AC_MC_VFS_SFS
  69. AC_MC_VFS_UNDELFS
  70. AC_MC_VFS_MCFS
  71. AC_MC_VFS_SAMBA
  72. MC_WITH_VFS
  73. else
  74. vfs_type="Plain OS filesystem"
  75. fi
  76. AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])
  77. ])