Ticket #1627: glib macros fix.
[midnight-commander.git] / m4.include / mc-vfs.m4
blobd5ca7ebbe5dd469d890e935090627200f0f2c6a1
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 use_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       MC_MCSERVER_CHECKS
54       use_net_code=true
55     fi
56   fi
59   AC_DEFINE(USE_VFS, 1, [Define to enable VFS support])
60   if $use_net_code; then
61     AC_DEFINE(USE_NETCODE, 1, [Define to use networked VFS])
62   fi
65 AC_DEFUN([AC_MC_VFS_CHECKS],[
66     AC_ARG_ENABLE([vfs],
67                   [  --disable-vfs           Compile with VFS code])
68     if test x"$enable_vfs" != x"no" ; then
69         enable_vfs="yes"
70         vfs_type="Midnight Commander Virtual Filesystem"
71         use_vfs=yes
73         AC_MSG_NOTICE([Enabling VFS code])
75         AC_MC_MVFS_FILESYSTEMS
77         AC_MC_VFS_CPIOFS
78         AC_MC_VFS_TARFS
79         AC_MC_VFS_FTP
80         AC_MC_VFS_FISH
81         AC_MC_VFS_EXTFS
82         AC_MC_VFS_SFS
83         AC_MC_VFS_UNDELFS
84         AC_MC_VFS_MCFS
85         AC_MC_VFS_SAMBA
87         MC_WITH_VFS
89     else
90         vfs_type="Plain OS filesystem"
91     fi
93     AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])