Prepare to support gss authentication and idmap looks for nfsv4
[nfs-utils.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_INIT(rules.mk)
4 AC_PREFIX_DEFAULT(/usr)
5
6 # The nfs-utils version
7 VERSION="1.0.6"
8 AC_SUBST(VERSION)
9
10 dnl *************************************************************
11 dnl * Define the set of applicable options
12 dnl *************************************************************
13 AC_ARG_WITH(release,
14         [  --with-release=XXX      set release to XXX [1]],
15         RELEASE=$withval,
16         RELEASE=1)
17         AC_SUBST(RELEASE)
18 AC_ARG_WITH(statedir,
19         [  --with-statedir=/foo    use state dir /foo [/var/lib/nfs]],
20         statedir=$withval,
21         statedir=/var/lib/nfs)
22         AC_SUBST(statedir)
23 AC_ARG_WITH(statduser,
24         [  --with-statduser=rpcuser user for statd to run under [rpcuser or nobody]],
25         statduser=$withval,
26         if grep -s '^rpcuser:' /etc/passwd > /dev/null; then
27                 statduser=rpcuser
28         else
29                 statduser=nobody
30         fi)
31         AC_SUBST(statduser)
32 AC_ARG_ENABLE(nfsv3,
33         [  --enable-nfsv3          enable support for NFSv3],
34         enable_nfsv3=$enableval,
35         enable_nfsv3=yes)
36         if test "$enable_nfsv3" = yes; then
37                 AC_DEFINE(NFS3_SUPPORTED)
38         else
39                 enable_nfsv3=
40         fi
41         AC_SUBST(enable_nfsv3)
42 AC_ARG_ENABLE(nfsv4,
43         [  --enable-nfsv4          enable support for NFSv4],
44         enable_nfsv4=$enableval,
45         enable_nfsv4=yes)
46         if test "$enable_nfsv4" = yes; then
47                 AC_DEFINE(NFS4_SUPPORTED)
48                 IDMAPD=idmapd
49         else
50                 enable_nfsv4=
51                 IDMAPD=
52         fi
53         AC_SUBST(IDMAPD)
54         AC_SUBST(enable_nfsv4)
55 AC_ARG_ENABLE(kprefix,
56         [  --enable-kprefix       install progs as rpc.knfsd etc],
57         test "$enableval" = "yes" && kprefix=k,
58         kprefix=)
59         AC_SUBST(kprefix)
60 AC_ARG_ENABLE(secure-statd,
61         [  --enable-secure-statd  Only lockd can use statd (security)],
62         test "$enableval" = "yes" && secure_statd=yes,
63         secure_statd=no)
64         if test "$secure_statd" = yes; then
65                 AC_DEFINE(RESTRICTED_STATD)
66         fi
67         AC_SUBST(secure_statd)
68 AC_ARG_ENABLE(rquotad,
69         [  --enable-rquotad          enable rquotad],
70         enable_rquotad=$enableval,
71         enable_rquotad=yes)
72         if test "$enable_rquotad" = yes; then
73                 RQUOTAD=rquotad
74         else
75                 RQUOTAD=
76         fi
77         AC_SUBST(RQUOTAD)
78 dnl AC_ARG_ENABLE(frob, enable frobnicator,,                enable_frob=test)
79 AC_CONFIG_HEADER(support/include/config.h)
80
81 AC_PROG_CC
82 AC_PROG_CPP
83 AC_PROG_INSTALL
84
85 test "${CC_FOR_BUILD+set}" = set || CC_FOR_BUILD="$CC"
86 AC_SUBST(CC_FOR_BUILD)
87
88 AC_CHECK_TOOL(RANLIB, ranlib, :)
89 AC_CHECK_TOOL(AR, ar)
90 AC_CHECK_TOOL(LD, ld)
91
92 AC_STDC_HEADERS
93 AC_GNULIBC
94 dnl AC_LN_SF
95 dnl AC_BSD_SIGNALS
96
97 dnl *************************************************************
98 dnl * Check for required librarues
99 dnl *************************************************************
100 AC_CHECK_LIB(socket, main, [LIBSOCKET="-lnsl"])
101 AC_CHECK_LIB(nsl, main, [LIBNSL="-lnsl"])
102 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"])
103 if test "$enable_nfsv4" = yes; then
104     AC_CHECK_LIB(event, event_dispatch)
105     AC_CHECK_LIB(nfsidmap, nfs4_uid_to_name)
106     AC_CHECK_HEADERS(event.h)
107     AC_CHECK_HEADERS(nfsidmap.h)
108 fi
109 if test "$knfsd_cv_glibc2" = no; then
110     AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
111 fi
112 AC_SUBST(LIBSOCKET)
113 AC_SUBST(LIBNSL)
114 AC_SUBST(LIBCRYPT)
115 AC_SUBST(LIBBSD)
116
117 AC_TCP_WRAPPER
118 AC_SUBST(LIBWRAP)
119
120 dnl *************************************************************
121 dnl Check for headers
122 dnl *************************************************************
123 dnl AC_HAVE_HEADERS(string.h)
124
125 dnl *************************************************************
126 dnl Check for functions
127 dnl *************************************************************
128 AC_HAVE_FUNCS(innetgr)
129
130 dnl *************************************************************
131 dnl Export some path names to config.h
132 dnl *************************************************************
133 AC_DEFINE_UNQUOTED(NFS_STATEDIR, "$statedir")
134
135 AC_SUBST(LDFLAGS)
136 AC_SUBST(CXXFLAGS)
137 AC_SUBST(CFLAGS)
138 AC_OUTPUT(config.mk nfs-utils.spec utils/Makefile)