1 dnl Process this file with autoconf to produce a configure script.
4 AC_PREFIX_DEFAULT(/usr)
6 # The nfs-utils version
10 dnl *************************************************************
11 dnl * Define the set of applicable options
12 dnl *************************************************************
14 [ --with-release=XXX set release to XXX [1]],
19 [ --with-statedir=/foo use state dir /foo [/var/lib/nfs]],
21 statedir=/var/lib/nfs)
23 AC_ARG_WITH(statduser,
24 [ --with-statduser=rpcuser user for statd to run under [rpcuser or nobody]],
26 if grep -s '^rpcuser:' /etc/passwd > /dev/null; then
33 [ --enable-nfsv3 enable support for NFSv3],
34 enable_nfsv3=$enableval,
36 if test "$enable_nfsv3" = yes; then
37 AC_DEFINE(NFS3_SUPPORTED)
41 AC_SUBST(enable_nfsv3)
43 [ --enable-nfsv4 enable support for NFSv4],
44 enable_nfsv4=$enableval,
46 if test "$enable_nfsv4" = yes; then
47 AC_DEFINE(NFS4_SUPPORTED)
54 AC_SUBST(enable_nfsv4)
56 [ --enable-gss enable support for rpcsec_gss],
57 enable_gss=$enableval,
59 if test "$enable_gss" = yes; then
60 AC_DEFINE(GSS_SUPPORTED)
71 AC_ARG_ENABLE(kprefix,
72 [ --enable-kprefix install progs as rpc.knfsd etc],
73 test "$enableval" = "yes" && kprefix=k,
76 AC_ARG_ENABLE(secure-statd,
77 [ --enable-secure-statd Only lockd can use statd (security)],
78 test "$enableval" = "yes" && secure_statd=yes,
80 if test "$secure_statd" = yes; then
81 AC_DEFINE(RESTRICTED_STATD)
83 AC_SUBST(secure_statd)
84 AC_ARG_ENABLE(rquotad,
85 [ --enable-rquotad enable rquotad],
86 enable_rquotad=$enableval,
88 if test "$enable_rquotad" = yes; then
94 dnl AC_ARG_ENABLE(frob, enable frobnicator,, enable_frob=test)
95 AC_CONFIG_HEADER(support/include/config.h)
101 test "${CC_FOR_BUILD+set}" = set || CC_FOR_BUILD="$CC"
102 AC_SUBST(CC_FOR_BUILD)
104 AC_CHECK_TOOL(RANLIB, ranlib, :)
105 AC_CHECK_TOOL(AR, ar)
106 AC_CHECK_TOOL(LD, ld)
113 dnl *************************************************************
114 dnl * Check for required librarues
115 dnl *************************************************************
116 AC_CHECK_LIB(socket, main, [LIBSOCKET="-lnsl"])
117 AC_CHECK_LIB(nsl, main, [LIBNSL="-lnsl"])
118 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"])
119 if test "$enable_nfsv4" = yes; then
120 AC_CHECK_LIB(event, event_dispatch, , [AC_MSG_ERROR(libevent needed for nfsv4 support)])
121 AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, ,[AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)])
122 AC_CHECK_HEADERS(event.h, ,[AC_MSG_ERROR(libevent needed for nfsv4 support)])
123 AC_CHECK_HEADERS(nfsidmap.h, ,[AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)])
125 if test "$knfsd_cv_glibc2" = no; then
126 AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
136 if test "$enable_gss" = yes; then
137 dnl Checks for Kerberos
138 dnl NOTE: while we intend to do generic gss-api, currently we
139 dnl have a requirement to get an initial Kerberos machine
140 dnl credential. Thus, the requirement for Kerberos.
141 dnl The Kerberos gssapi library will be dynamically loaded?
142 AC_MSG_CHECKING(for Kerberos v5)
144 [ --with-krb5=DIR use Kerberos v5 installation in DIR],
155 for dir in $krb5_with /usr/kerberos /usr/local /usr/local/krb5 /usr/krb5 \
156 /usr/heimdal /usr/local/heimdal /usr/athena /usr ; do
157 dnl This ugly hack brought on by the split installation of
158 dnl MIT Kerberos on Fedora Core 1
160 if test -f $dir/bin/krb5-config; then
161 K5CONFIG=$dir/bin/krb5-config
162 elif test -f "/usr/kerberos/bin/krb5-config"; then
163 K5CONFIG="/usr/kerberos/bin/krb5-config"
165 if test "$K5CONFIG" != ""; then
166 if test -f $dir/include/gssapi/gssapi_krb5.h -a \
167 \( -f $dir/lib/libgssapi_krb5.a -o \
168 -f $dir/lib/libgssapi_krb5.so \) ; then
171 K5VERS=`$K5CONFIG --version | awk '{split($4,v,"."); print v[[1]]v[[2]]v[[3]] }'`
172 AC_DEFINE_UNQUOTED(KRB5_VERSION,$K5VERS)
173 KRBLIB=`$K5CONFIG --libs gssapi`
174 if test $K5VERS -le 131; then
175 AC_DEFINE(USE_PRIVATE_KRB5_FUNCTIONS)
177 AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
178 AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT),,$KRBLIB)
179 AC_CHECK_LIB(gssapi_krb5, gss_krb5_set_allowable_enctypes,
180 AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES),,$KRBLIB)
181 AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,
182 AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME),,$KRBLIB)
184 dnl The following ugly hack brought on by the split installation
185 dnl of Heimdal Kerberos on SuSe
186 elif test \( -f $dir/include/heim_err.h -o\
187 -f $dir/include/heimdal/heim_err.h \) -a \
188 -f $dir/lib/libroken.a; then
189 AC_DEFINE(HAVE_HEIMDAL)
191 K5VERS=`$K5CONFIG --version | head -1 | awk '{split($2,v,"."); print v[[1]]v[[2]]v[[3]] }'`
192 AC_DEFINE_UNQUOTED(KRB5_VERSION,$K5VERS)
193 KRBLIB=`$K5CONFIG --libs gssapi`
194 AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
195 AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT),,$KRBLIB)
196 AC_CHECK_LIB(gssapi, gss_krb5_set_allowable_enctypes,
197 AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES),,$KRBLIB)
198 AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,
199 AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME),,$KRBLIB)
202 CFLAGS=$CFLAGS `K5CONFIG --cflags`
205 dnl We didn't find a usable Kerberos environment
206 if test "x$KRBDIR" = "x"; then
208 if test "x$krb5_with" = "x"; then
209 AC_MSG_ERROR(Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=)
211 AC_MSG_ERROR(Kerberos v5 with GSS support not found at $krb5_with)
214 AC_MSG_RESULT($KRBDIR)
215 dnl If they specified a directory and it didn't work, give them a warning
216 if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then
217 AC_MSG_WARN(Using $KRBDIR instead of requested value of $krb5_with for Kerberos!)
225 dnl *************************************************************
226 dnl Check for headers
227 dnl *************************************************************
228 dnl AC_HAVE_HEADERS(string.h)
230 dnl *************************************************************
231 dnl Check for functions
232 dnl *************************************************************
233 AC_HAVE_FUNCS(innetgr)
235 dnl *************************************************************
236 dnl Export some path names to config.h
237 dnl *************************************************************
238 AC_DEFINE_UNQUOTED(NFS_STATEDIR, "$statedir")
243 AC_OUTPUT(config.mk utils/Makefile)