mc-vfs.m4 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. use_net_code=true
  46. fi
  47. fi
  48. AC_DEFINE(ENABLE_VFS, 1, [Define to enable VFS support])
  49. if $use_net_code; then
  50. AC_DEFINE(USE_NETCODE, 1, [Define to use networked VFS])
  51. fi
  52. ])
  53. AC_DEFUN([AC_MC_VFS_CHECKS],[
  54. AC_ARG_ENABLE([vfs],
  55. [ --disable-vfs Disable VFS])
  56. if test x"$enable_vfs" != x"no" ; then
  57. enable_vfs="yes"
  58. vfs_type="Midnight Commander Virtual Filesystem"
  59. AC_MSG_NOTICE([Enabling VFS code])
  60. AC_MC_VFS_CPIOFS
  61. AC_MC_VFS_TARFS
  62. AC_MC_VFS_FTP
  63. AC_MC_VFS_FISH
  64. AC_MC_VFS_EXTFS
  65. AC_MC_VFS_SFS
  66. AC_MC_VFS_UNDELFS
  67. AC_MC_VFS_MCFS
  68. AC_MC_VFS_SAMBA
  69. MC_WITH_VFS
  70. else
  71. vfs_type="Plain OS filesystem"
  72. AM_CONDITIONAL(ENABLE_VFS_CPIO, [false])
  73. AM_CONDITIONAL(ENABLE_VFS_TAR, [false])
  74. AM_CONDITIONAL(ENABLE_VFS_FTP, [false])
  75. AM_CONDITIONAL(ENABLE_VFS_FISH, [false])
  76. AM_CONDITIONAL(ENABLE_VFS_EXTFS, [false])
  77. AM_CONDITIONAL(ENABLE_VFS_SFS, [false])
  78. AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [false])
  79. fi
  80. MC_MCSERVER_CHECKS
  81. AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])
  82. ])