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