source: trunk/third/gtkhtml/macros/gnome-vfs.m4 @ 16767

Revision 16767, 3.0 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r16766, which included commits to RCS files with non-trunk default branches.
Line 
1dnl GNOME_VFS_CHECKS
2dnl   Check for various functions needed by libvfs.
3dnl   This has various effects:
4dnl     Sets GNOME_VFS_LIBS to libraries required
5dnl     Sets termnet  to true or false depending on whether it is required.
6dnl        If yes, defines USE_TERMNET.
7dnl     Sets vfs_flags to "pretty" list of vfs implementations we include.
8dnl     Sets shell variable use_vfs to yes (default, --with-vfs) or
9dnl        "no" (--without-vfs).
10dnl     Calls AC_SUBST(mcserv), which is either empty or "mcserv".
11
12dnl Private define
13AC_DEFUN([GNOME_WITH_VFS],[
14  dnl FIXME: network checks should probably be in their own macro.
15  AC_CHECK_LIB(nsl, t_accept)
16  AC_CHECK_LIB(socket, socket)
17
18  have_socket=no
19  AC_CHECK_FUNCS(socket, have_socket=yes)
20  if test $have_socket = no; then
21    # socket is not in the default libraries.  See if it's in some other.
22    for lib in bsd socket inet; do
23      AC_CHECK_LIB($lib, socket, [
24          LIBS="$LIBS -l$lib"
25          have_socket=yes
26          AC_DEFINE(HAVE_SOCKET)
27          break])
28    done
29  fi
30
31  have_gethostbyname=no
32  AC_CHECK_FUNC(gethostbyname, have_gethostbyname=yes)
33  if test $have_gethostbyname = no; then
34    # gethostbyname is not in the default libraries.  See if it's in some other.
35    for lib in bsd socket inet; do
36      AC_CHECK_LIB($lib, gethostbyname, [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
37    done
38  fi
39
40  vfs_flags="tarfs"
41  use_net_code=false
42  if test $have_socket = yes; then
43      AC_STRUCT_LINGER
44      AC_CHECK_FUNCS(pmap_set, , [
45         AC_CHECK_LIB(rpc, pmap_set, [
46           LIBS="-lrpc $LIBS"
47          AC_DEFINE(HAVE_PMAP_SET)
48          ])])
49      AC_CHECK_FUNCS(pmap_getport pmap_getmaps rresvport)
50      dnl add for source routing support setsockopt
51      AC_CHECK_HEADERS(rpc/pmap_clnt.h, , , [
52#include <sys/types.h>
53#include <sys/socket.h>
54#include <netinet/in.h>
55#include <rpc/rpc.h>
56#include <rpc/pmap_prot.h>
57                                            ])
58      vfs_flags="$vfs_flags, mcfs, ftpfs, fish"
59      use_net_code=true
60  fi
61
62  dnl
63  dnl Samba support
64  dnl
65  smbfs=""
66  SAMBAFILES=""
67  AC_ARG_WITH(samba,
68          [--with-samba             Support smb virtual file system],[
69          if test "x$withval" != "xno"; then
70                  AC_DEFINE(WITH_SMBFS)
71                  vfs_flags="$vfs_flags, smbfs"
72                  smbfs="smbfs.o"
73                  SAMBAFILES="\$(SAMBAFILES)"
74          fi
75  ])
76  AC_SUBST(smbfs)
77  AC_SUBST(SAMBAFILES)
78 
79  dnl
80  dnl The termnet support
81  dnl
82  termnet=false
83  AC_ARG_WITH(termnet,
84          [--with-termnet             If you want a termified net support],[
85          if test x$withval = xyes; then
86                  AC_DEFINE(USE_TERMNET)
87                  termnet=true         
88          fi
89  ])
90
91  TERMNET=""
92  AC_DEFINE(USE_VFS)
93  if $use_net_code; then
94     AC_DEFINE(USE_NETCODE)
95  fi
96  mcserv=
97  if test $have_socket = yes; then
98     mcserv="mcserv"
99     if $termnet; then
100        TERMNET="-ltermnet"
101     fi
102  fi
103
104  AC_SUBST(TERMNET)
105  AC_SUBST(mcserv)
106
107dnl FIXME:
108dnl GNOME_VFS_LIBS=
109
110])
111
112AC_DEFUN([GNOME_VFS_CHECKS],[
113        use_vfs=yes
114        AC_ARG_WITH(vfs,
115                [--with-vfs                Compile with the VFS code],
116                use_vfs=$withval
117        )
118        case $use_vfs in
119                yes)    GNOME_WITH_VFS;;
120                no)     use_vfs=no;;
121                *)      use_vfs=no;;
122                        dnl Should we issue a warning?
123        esac
124])
125
126
Note: See TracBrowser for help on using the repository browser.