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