2 # Process this file with autoconf to produce a configure script.
4 AC_INIT([cifs-utils], [5.4.1], [cifs-utils@samba.org], [cifs-utils], [https://wiki.samba.org/index.php/LinuxCIFS_utils])
5 AC_CONFIG_SRCDIR([replace.h])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_FILES([Makefile contrib/Makefile contrib/request-key.d/Makefile])
8 AC_CONFIG_MACRO_DIR(aclocal)
13 AC_ARG_ENABLE(cifsupcall,
14 [AC_HELP_STRING([--enable-cifsupcall],
15 [Create cifs.upcall binary @<:@default=yes@:>@])],
16 enable_cifsupcall=$enableval,
17 enable_cifsupcall="maybe")
19 AC_ARG_ENABLE(cifscreds,
20 [AC_HELP_STRING([--enable-cifscreds],
21 [Create cifscreds utility @<:@default=yes@:>@])],
22 enable_cifscreds=$enableval,
23 enable_cifscreds="maybe")
25 AC_ARG_ENABLE(cifsidmap,
26 [AC_HELP_STRING([--enable-cifsidmap],
27 [Create cifs.idmap binary @<:@default=yes@:>@])],
28 enable_cifsidmap=$enableval,
29 enable_cifsidmap="maybe")
31 AC_ARG_ENABLE(cifsacl,
32 [AC_HELP_STRING([--enable-cifsacl],
33 [Create get/set cifsacl binary @<:@default=yes@:>@])],
34 enable_cifsacl=$enableval,
35 enable_cifsacl="maybe")
37 # check for ROOTSBINDIR environment var
38 if test -z $ROOTSBINDIR; then
43 AC_ARG_VAR(ROOTSBINDIR, [Location where files ordinarily under /sbin should be installed. Note: unaffected by --prefix. @<:@default=/sbin@:>@])
45 # Checks for programs.
51 # Checks for typedefs, structures, and compiler characteristics.
57 AC_CHECK_TYPES([ptrdiff_t, ssize_t, uint32_t, uint8_t])
59 # Checks for library functions.
61 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
66 # check for required functions
67 AC_CHECK_FUNCS([alarm atexit endpwent getmntent getpass gettimeofday inet_ntop memset realpath setenv strchr strcmp strdup strerror strncasecmp strndup strpbrk strrchr strstr strtol strtoul tolower uname], , [AC_MSG_ERROR([necessary functions(s) not found])])
69 AC_CHECK_FUNCS(clock_gettime, [], [
70 AC_CHECK_LIB(rt, clock_gettime, [
71 AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
72 AC_DEFINE(HAVE_CLOCK_GETTIME,1,
73 [Whether the clock_gettime func is there])
78 # Checks for header files.
79 AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h inttypes.h limits.h mntent.h netdb.h stddef.h stdint.h stdbool.h stdlib.h stdio.h errno.h string.h strings.h sys/mount.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h], , [AC_MSG_ERROR([necessary header(s) not found])])
81 # do we have sys/fsuid.h and setfsuid()?
82 AC_CHECK_HEADERS([sys/fsuid.h])
83 AC_CHECK_FUNC(setfsuid, , [AC_MSG_ERROR([System does not support setfsuid()])])
85 if test $enable_cifsupcall != "no"; then
86 AC_CHECK_HEADERS([krb5.h krb5/krb5.h])
87 if test x$ac_cv_header_krb5_krb5_h != xyes ; then
88 if test x$ac_cv_header_krb5_h != xyes ; then
89 if test "$enable_cifsupcall" = "yes"; then
90 AC_MSG_ERROR([krb5.h not found, consider installing krb5-libs-devel.])
92 AC_MSG_WARN([krb5.h not found, consider installing krb5-libs-devel. Disabling cifs.upcall.])
93 enable_cifsupcall="no"
98 if test $enable_cifsupcall != "no"; then
99 if test x$ac_cv_header_krb5_krb5_h = xyes ; then
100 krb5_include="#include <krb5/krb5.h>"
102 if test x$ac_cv_header_krb5_h = xyes ; then
103 krb5_include="#include <krb5.h>"
106 AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
107 [ac_cv_have_krb5_keyblock_keyvalue],[
108 AC_TRY_COMPILE([$krb5_include],
109 [krb5_keyblock key; key.keyvalue.data = NULL;],
110 ac_cv_have_krb5_keyblock_keyvalue=yes,
111 ac_cv_have_krb5_keyblock_keyvalue=no)])
112 if test x"$ac_cv_have_krb5_keyblock_keyvalue" = x"yes" ; then
113 AC_DEFINE(HAVE_KRB5_KEYBLOCK_KEYVALUE,1,
114 [Whether the krb5_keyblock struct has a keyvalue property])
117 if test $enable_cifsupcall != "no"; then
118 AC_CHECK_HEADERS([talloc.h], , [
119 if test "$enable_cifsupcall" = "yes"; then
120 AC_MSG_ERROR([talloc.h not found, consider installing libtalloc-devel.])
122 AC_MSG_WARN([talloc.h not found, consider installing libtalloc-devel. Disabling cifs.upcall.])
123 enable_cifsupcall="no"
127 if test $enable_cifsupcall != "no" -o $enable_cifsidmap != "no"; then
128 AC_CHECK_HEADERS([keyutils.h], , [
129 if test "$enable_cifsupcall" = "yes"; then
130 AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
132 AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifs.upcall.])
133 enable_cifsupcall="no"
135 if test "$enable_cifsidmap" = "yes"; then
136 AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
138 AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifs.idmap.])
139 enable_cifsidmap="no"
143 if test $enable_cifsupcall != "no"; then
144 AC_CHECK_LIB([krb5], [krb5_init_context],
145 [ KRB5_LDADD='-lkrb5' ],
146 AC_MSG_ERROR([no functioning krb5 library found!]))
150 # checks for wbclient.h and libwbclient.so library
153 if test $enable_cifscreds != "no"; then
154 AC_CHECK_HEADERS([keyutils.h], , [
156 if test $enable_cifscreds = "yes"; then
157 AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
159 AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifscreds.])
160 enable_cifscreds="no"
166 # ugly, but I'm not sure how to check for functions in a library that's not in $LIBS
168 LIBS="$LIBS $KRB5_LDADD"
170 # determine whether we can use MIT's new 'krb5_auth_con_getsendsubkey' to extract the signing key
171 if test $enable_cifsupcall != "no"; then
172 AC_CHECK_FUNCS([krb5_auth_con_getsendsubkey])
175 # non-critical functions (we have workarounds for these)
176 if test $enable_cifsupcall != "no"; then
177 AC_CHECK_FUNCS([krb5_principal_get_realm krb5_free_unparsed_name])
178 AC_CHECK_FUNCS([krb5_auth_con_setaddrs krb5_auth_con_set_req_cksumtype])
181 # MIT krb5 < 1.7 does not have this declaration but does have the symbol
182 AC_CHECK_DECLS(krb5_auth_con_set_req_cksumtype, [], [], [#include <krb5.h>])
186 AM_CONDITIONAL(CONFIG_CIFSUPCALL, [test "$enable_cifsupcall" != "no"])
187 AM_CONDITIONAL(CONFIG_CIFSCREDS, [test "$enable_cifscreds" != "no"])
188 AM_CONDITIONAL(CONFIG_CIFSIDMAP, [test "$enable_cifsidmap" != "no"])
189 AM_CONDITIONAL(CONFIG_CIFSACL, [test "$enable_cifsacl" != "no"])
193 if test "x$CAPNG_LDADD" = "x"; then