Ticket #2738: handle errors at mc sturtup stage.
[midnight-commander.git] / m4.include / mc-vfs.m4
blob7d732595828177af4075c32df53e14766b67961e
1 AC_DEFUN([AC_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/rpc.m4])
11 m4_include([m4.include/vfs/socket.m4])
12 m4_include([m4.include/vfs/mc-vfs-extfs.m4])
13 m4_include([m4.include/vfs/mc-vfs-sfs.m4])
14 m4_include([m4.include/vfs/mc-vfs-ftp.m4])
15 m4_include([m4.include/vfs/mc-vfs-fish.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])
19 m4_include([m4.include/vfs/mc-vfs-samba.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).
29 dnl Private define
30 AC_DEFUN([MC_ENABLE_VFS_NET],
32     dnl FIXME: network checks should probably be in their own macro.
33     AC_REQUIRE_SOCKET
34     if test x"$have_socket" = xyes; then
35         AC_CHECK_TYPE([nlink_t], ,
36                         [AC_DEFINE_UNQUOTED([nlink_t], [unsigned int],
37                             [Define to `unsigned int' if <sys/types.h> does not define.])])
38         AC_CHECK_TYPES([socklen_t],,,
39             [
40 #include <sys/types.h>
41 #include <sys/socket.h>
42             ])
44         AC_CHECK_RPC
46         enable_vfs_net=yes
47     fi
50 AC_DEFUN([AC_MC_VFS_CHECKS],
52     vfs_type="normal"
54     AC_ARG_ENABLE([vfs],
55         AS_HELP_STRING([--disable-vfs], [Disable VFS]),
56         [
57             if test "x$enableval" = "xno"; then
58                 enable_vfs=no
59             else
60                 enable_vfs=yes
61             fi
62         ],
63         [enable_vfs=yes])
65     if test x"$enable_vfs" = x"yes" ; then
66         vfs_type="Midnight Commander Virtual Filesystem"
67         AC_MSG_NOTICE([Enabling VFS code])
68         AC_DEFINE(ENABLE_VFS, [1], [Define to enable VFS support])
69     fi
71     AC_MC_VFS_CPIOFS
72     AC_MC_VFS_TARFS
73     AC_MC_VFS_SFS
74     AC_MC_VFS_EXTFS
75     AC_MC_VFS_UNDELFS
76     AC_MC_VFS_FTP
77     AC_MC_VFS_FISH
78     AC_MC_VFS_SMB
80     AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])
82     if test x"$enable_vfs_ftp" = x"yes" -o x"$enable_vfs_fish" = x"yes" -o x"$enable_vfs_smb" = x"yes"; then
83         MC_ENABLE_VFS_NET
84     fi
86     AM_CONDITIONAL([ENABLE_VFS_NET], [test x"$enable_vfs_net" = x"yes"])