2 # Process this file with autoconf to produce a configure script.
4 AC_INIT([cifs-utils], [5.2.1], [cifs-utils@samba.org], [cifs-utils], [http://linux-cifs.samba.org/cifs-utils/])
5 AC_CONFIG_SRCDIR([replace.h])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_FILES([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=no@:>@])],
22 enable_cifscreds=$enableval,
23 enable_cifscreds="no")
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 # Checks for programs.
42 # Checks for typedefs, structures, and compiler characteristics.
48 AC_CHECK_TYPES([ptrdiff_t, ssize_t, uint32_t, uint8_t])
50 # Checks for library functions.
52 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
57 # check for required functions
58 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])])
60 AC_CHECK_FUNCS(clock_gettime, [], [
61 AC_CHECK_LIB(rt, clock_gettime, [
62 AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
63 AC_DEFINE(HAVE_CLOCK_GETTIME,1,
64 [Whether the clock_gettime func is there])
69 # Checks for header files.
70 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])])
72 if test $enable_cifsupcall != "no"; then
73 AC_CHECK_HEADERS([krb5.h krb5/krb5.h])
74 if test x$ac_cv_header_krb5_krb5_h != xyes ; then
75 if test x$ac_cv_header_krb5_h != xyes ; then
76 if test "$enable_cifsupcall" = "yes"; then
77 AC_MSG_ERROR([krb5.h not found, consider installing krb5-libs-devel.])
79 AC_MSG_WARN([krb5.h not found, consider installing krb5-libs-devel. Disabling cifs.upcall.])
80 enable_cifsupcall="no"
85 if test $enable_cifsupcall != "no"; then
86 if test x$ac_cv_header_krb5_krb5_h = xyes ; then
87 krb5_include="#include <krb5/krb5.h>"
89 if test x$ac_cv_header_krb5_h = xyes ; then
90 krb5_include="#include <krb5.h>"
93 AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
94 [ac_cv_have_krb5_keyblock_keyvalue],[
95 AC_TRY_COMPILE([$krb5_include],
96 [krb5_keyblock key; key.keyvalue.data = NULL;],
97 ac_cv_have_krb5_keyblock_keyvalue=yes,
98 ac_cv_have_krb5_keyblock_keyvalue=no)])
99 if test x"$ac_cv_have_krb5_keyblock_keyvalue" = x"yes" ; then
100 AC_DEFINE(HAVE_KRB5_KEYBLOCK_KEYVALUE,1,
101 [Whether the krb5_keyblock struct has a keyvalue property])
104 if test $enable_cifsupcall != "no"; then
105 AC_CHECK_HEADERS([talloc.h], , [
106 if test "$enable_cifsupcall" = "yes"; then
107 AC_MSG_ERROR([talloc.h not found, consider installing libtalloc-devel.])
109 AC_MSG_WARN([talloc.h not found, consider installing libtalloc-devel. Disabling cifs.upcall.])
110 enable_cifsupcall="no"
114 if test $enable_cifsupcall != "no" -o $enable_cifsidmap != "no"; then
115 AC_CHECK_HEADERS([keyutils.h], , [
116 if test "$enable_cifsupcall" = "yes"; then
117 AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
119 AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifs.upcall.])
120 enable_cifsupcall="no"
122 if test "$enable_cifsidmap" = "yes"; then
123 AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
125 AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifs.idmap.])
126 enable_cifsidmap="no"
130 if test $enable_cifsacl != "no"; then
131 AC_CHECK_HEADERS([wbclient.h], , [
132 if test "$enable_cifsacl" = "yes"; then
133 AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.])
135 AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling getcifsacl.])
139 [AC_INCLUDES_DEFAULT]
140 [#ifdef HAVE_STDBOOL_H
145 if test $enable_cifsupcall != "no"; then
146 AC_CHECK_LIB([krb5], [krb5_init_context],
147 [ KRB5_LDADD='-lkrb5' ],
148 AC_MSG_ERROR([no functioning krb5 library found!]))
152 # checks for wbclient.h and libwbclient.so library
155 if test $enable_cifscreds = "yes"; then
156 AC_CHECK_HEADERS([keyutils.h], , [AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])])
160 # ugly, but I'm not sure how to check for functions in a library that's not in $LIBS
162 LIBS="$LIBS $KRB5_LDADD"
164 # determine whether we can use MIT's new 'krb5_auth_con_getsendsubkey' to extract the signing key
165 if test $enable_cifsupcall != "no"; then
166 AC_CHECK_FUNCS([krb5_auth_con_getsendsubkey])
169 # non-critical functions (we have workarounds for these)
170 if test $enable_cifsupcall != "no"; then
171 AC_CHECK_FUNCS([krb5_principal_get_realm krb5_free_unparsed_name])
172 AC_CHECK_FUNCS([krb5_auth_con_setaddrs krb5_auth_con_set_req_cksumtype])
177 AM_CONDITIONAL(CONFIG_CIFSUPCALL, [test "$enable_cifsupcall" != "no"])
178 AM_CONDITIONAL(CONFIG_CIFSCREDS, [test "$enable_cifscreds" = "yes"])
179 AM_CONDITIONAL(CONFIG_CIFSIDMAP, [test "$enable_cifsidmap" != "no"])
180 AM_CONDITIONAL(CONFIG_CIFSACL, [test "$enable_cifsacl" != "no"])
184 if test "x$CAPNG_LDADD" = "x"; then