|
Packit |
5f9837 |
# -*- Autoconf -*-
|
|
Packit |
5f9837 |
# Process this file with autoconf to produce a configure script.
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_INIT([cifs-utils],[6.8],[linux-cifs@vger.kernel.org],[cifs-utils],[https://wiki.samba.org/index.php/LinuxCIFS_utils])
|
|
Packit |
5f9837 |
AC_CONFIG_SRCDIR([data_blob.h])
|
|
Packit |
5f9837 |
AC_CONFIG_HEADERS([config.h])
|
|
Packit |
5f9837 |
AC_CONFIG_FILES([Makefile contrib/Makefile contrib/request-key.d/Makefile])
|
|
Packit |
5f9837 |
AC_CONFIG_MACRO_DIR(aclocal)
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AM_INIT_AUTOMAKE
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# "enable" options
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(pie,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-pie],[Produce position independent executables @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_pie=$enableval,
|
|
Packit |
5f9837 |
enable_pie="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(relro,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-relro],[Enable relocations read-only support @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_relro=$enableval,
|
|
Packit |
5f9837 |
enable_relro="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(cifsupcall,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-cifsupcall],[Create cifs.upcall binary @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_cifsupcall=$enableval,
|
|
Packit |
5f9837 |
enable_cifsupcall="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(cifscreds,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-cifscreds],[Create cifscreds utility @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_cifscreds=$enableval,
|
|
Packit |
5f9837 |
enable_cifscreds="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(cifsidmap,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-cifsidmap],[Create cifs.idmap binary @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_cifsidmap=$enableval,
|
|
Packit |
5f9837 |
enable_cifsidmap="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(cifsacl,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-cifsacl],[Create get/set cifsacl binary @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_cifsacl=$enableval,
|
|
Packit |
5f9837 |
enable_cifsacl="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(pam,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-pam],[Create cifscreds PAM module @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_pam=$enableval,
|
|
Packit |
5f9837 |
enable_pam="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(systemd,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-systemd],[Enable systemd specific behavior for mount.cifs @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_systemd=$enableval,
|
|
Packit |
5f9837 |
enable_systemd="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_ENABLE(man,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--enable-man],[Enable generation and installation of man pages @<:@default=yes@:>@])],
|
|
Packit |
5f9837 |
enable_man=$enableval,
|
|
Packit |
5f9837 |
enable_man="maybe")
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# "with" options
|
|
Packit |
5f9837 |
AC_ARG_WITH(idmap-plugin,
|
|
Packit |
5f9837 |
[AS_HELP_STRING([--with-idmap-plugin=/path/to/plugin],[Define the path to the plugin that the idmapping infrastructure should use @<:@default=/etc/cifs-utils/idmap-plugin@:>@])],
|
|
Packit |
5f9837 |
pluginpath=$withval,
|
|
Packit |
5f9837 |
pluginpath="/etc/cifs-utils/idmap-plugin")
|
|
Packit |
5f9837 |
AC_DEFINE_UNQUOTED(IDMAP_PLUGIN_PATH, "$pluginpath", [Location of plugin that ID mapping infrastructure should use. (usually a symlink to real plugin)])
|
|
Packit |
5f9837 |
AC_SUBST([pluginpath])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_WITH(pamdir,
|
|
Packit |
5f9837 |
[AC_HELP_STRING([--with-pamdir=DIR],[Where to install the PAM module @<:@default=$(libdir)/security@:>@])],
|
|
Packit |
5f9837 |
pamdir=$withval,
|
|
Packit |
5f9837 |
pamdir="\$(libdir)/security")
|
|
Packit |
5f9837 |
AC_SUBST([pamdir])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# check for ROOTSBINDIR environment var
|
|
Packit |
5f9837 |
if test -z $ROOTSBINDIR; then
|
|
Packit |
5f9837 |
ROOTSBINDIR="/sbin"
|
|
Packit |
5f9837 |
export ROOTSBINDIR
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_ARG_VAR(ROOTSBINDIR, [Location where files ordinarily under /sbin should be installed. Note: unaffected by --prefix. @<:@default=/sbin@:>@])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# Checks for programs.
|
|
Packit |
5f9837 |
AC_PROG_CC
|
|
Packit |
5f9837 |
AC_USE_SYSTEM_EXTENSIONS
|
|
Packit |
5f9837 |
AM_PROG_CC_C_O
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# AC_PROG_SED is only avaliable in recent autoconf versions.
|
|
Packit |
5f9837 |
# Use AC_CHECK_PROG instead if AC_PROG_SED is not present.
|
|
Packit |
5f9837 |
ifdef([AC_PROG_SED],
|
|
Packit |
5f9837 |
[AC_PROG_SED],
|
|
Packit |
5f9837 |
[AC_CHECK_PROG(SED, sed, sed)])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# Checks for typedefs, structures, and compiler characteristics.
|
|
Packit |
5f9837 |
AC_HEADER_STDBOOL
|
|
Packit |
5f9837 |
AC_TYPE_UID_T
|
|
Packit |
5f9837 |
AC_TYPE_OFF_T
|
|
Packit |
5f9837 |
AC_TYPE_PID_T
|
|
Packit |
5f9837 |
AC_TYPE_SIZE_T
|
|
Packit |
5f9837 |
AC_CHECK_TYPES([ptrdiff_t, ssize_t, uint32_t, uint8_t])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# Checks for library functions.
|
|
Packit |
5f9837 |
AC_FUNC_GETMNTENT
|
|
Packit |
5f9837 |
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
|
|
Packit |
5f9837 |
AC_FUNC_MALLOC
|
|
Packit |
5f9837 |
AC_FUNC_REALLOC
|
|
Packit |
5f9837 |
AC_FUNC_STRNLEN
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# check for required functions
|
|
Packit |
5f9837 |
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])])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_CHECK_FUNCS(clock_gettime, [], [
|
|
Packit |
5f9837 |
AC_CHECK_LIB(rt, clock_gettime, [
|
|
Packit |
5f9837 |
AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
|
|
Packit |
5f9837 |
AC_DEFINE(HAVE_CLOCK_GETTIME,1,
|
|
Packit |
5f9837 |
[Whether the clock_gettime func is there])
|
|
Packit |
5f9837 |
RT_LDADD="-lrt"
|
|
Packit |
5f9837 |
])
|
|
Packit |
5f9837 |
])
|
|
Packit |
5f9837 |
AC_SUBST(RT_LDADD)
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# Checks for header files.
|
|
Packit |
5f9837 |
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])])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# do we have sys/fsuid.h and setfsuid()?
|
|
Packit |
5f9837 |
AC_CHECK_HEADERS([sys/fsuid.h])
|
|
Packit |
5f9837 |
AC_CHECK_FUNC(setfsuid, , [AC_MSG_ERROR([System does not support setfsuid()])])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# FIXME: add test(s) to autodisable these flags when compiler/linker don't support it
|
|
Packit |
5f9837 |
if test $enable_pie != "no"; then
|
|
Packit |
5f9837 |
PIE_CFLAGS="-fpie -pie"
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
PIE_CFLAGS=""
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
AC_SUBST([PIE_CFLAGS])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test $enable_relro != "no"; then
|
|
Packit |
5f9837 |
RELRO_CFLAGS="-Wl,-z,relro,-z,now"
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
RELRO_CFLAGS=""
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
AC_SUBST([RELRO_CFLAGS])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test $enable_cifsupcall != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_HEADERS([krb5.h krb5/krb5.h])
|
|
Packit |
5f9837 |
if test x$ac_cv_header_krb5_krb5_h != xyes ; then
|
|
Packit |
5f9837 |
if test x$ac_cv_header_krb5_h != xyes ; then
|
|
Packit |
5f9837 |
if test "$enable_cifsupcall" = "yes"; then
|
|
Packit |
5f9837 |
AC_MSG_ERROR([krb5.h not found, consider installing krb5-devel or krb5-libs-devel.])
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
AC_MSG_WARN([krb5.h not found, consider installing krb5-devel or krb5-libs-devel. Disabling cifs.upcall.])
|
|
Packit |
5f9837 |
enable_cifsupcall="no"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
if test $enable_cifsupcall != "no"; then
|
|
Packit |
5f9837 |
if test x$ac_cv_header_krb5_krb5_h = xyes ; then
|
|
Packit |
5f9837 |
krb5_include="#include <krb5/krb5.h>"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
if test x$ac_cv_header_krb5_h = xyes ; then
|
|
Packit |
5f9837 |
krb5_include="#include <krb5.h>"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
|
|
Packit |
5f9837 |
[ac_cv_have_krb5_keyblock_keyvalue],[
|
|
Packit |
5f9837 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$krb5_include]], [[krb5_keyblock key; key.keyvalue.data = NULL;]])],[ac_cv_have_krb5_keyblock_keyvalue=yes],[ac_cv_have_krb5_keyblock_keyvalue=no])])
|
|
Packit |
5f9837 |
if test x"$ac_cv_have_krb5_keyblock_keyvalue" = x"yes" ; then
|
|
Packit |
5f9837 |
AC_DEFINE(HAVE_KRB5_KEYBLOCK_KEYVALUE,1,
|
|
Packit |
5f9837 |
[Whether the krb5_keyblock struct has a keyvalue property])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
if test $enable_cifsupcall != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_HEADERS([talloc.h], , [
|
|
Packit |
5f9837 |
if test "$enable_cifsupcall" = "yes"; then
|
|
Packit |
5f9837 |
AC_MSG_ERROR([talloc.h not found, consider installing libtalloc-devel.])
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
AC_MSG_WARN([talloc.h not found, consider installing libtalloc-devel. Disabling cifs.upcall.])
|
|
Packit |
5f9837 |
enable_cifsupcall="no"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
if test $enable_cifsupcall != "no" -o $enable_cifsidmap != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_HEADERS([keyutils.h], , [
|
|
Packit |
5f9837 |
if test "$enable_cifsupcall" = "yes"; then
|
|
Packit |
5f9837 |
AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifs.upcall.])
|
|
Packit |
5f9837 |
enable_cifsupcall="no"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
if test "$enable_cifsidmap" = "yes"; then
|
|
Packit |
5f9837 |
AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifs.idmap.])
|
|
Packit |
5f9837 |
enable_cifsidmap="no"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
if test $enable_cifsupcall != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_LIB([krb5], [krb5_init_context],
|
|
Packit |
5f9837 |
[ KRB5_LDADD='-lkrb5' ],
|
|
Packit |
5f9837 |
AC_MSG_ERROR([no functioning krb5 library found!]))
|
|
Packit |
5f9837 |
AC_SUBST(KRB5_LDADD)
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# checks for wbclient.h and libwbclient.so library
|
|
Packit |
5f9837 |
AC_TEST_WBCHL
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# test for presence of WBC_ID_TYPE_BOTH enum value
|
|
Packit |
5f9837 |
AC_TEST_WBC_IDMAP_BOTH
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test $enable_cifscreds != "no" -o $enable_pam != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_HEADERS([keyutils.h], , [
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test $enable_cifscreds = "yes" -o $enable_pam = "yes"; then
|
|
Packit |
5f9837 |
AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
AC_MSG_WARN([keyutils.h not found, consider installing keyutils-libs-devel. Disabling cifscreds and cifscreds PAM module.])
|
|
Packit |
5f9837 |
enable_cifscreds="no"
|
|
Packit |
5f9837 |
enable_pam="no"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test $enable_pam != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_HEADERS([security/pam_appl.h], , [
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test $enable_pam = "yes"; then
|
|
Packit |
5f9837 |
AC_MSG_ERROR([security/pam_appl.h not found, consider installing keyutils-libs-devel.])
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
AC_MSG_WARN([security/pam_appl.h not found, consider installing pam-devel. Disabling cifscreds PAM module.])
|
|
Packit |
5f9837 |
enable_pam="no"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# ugly, but I'm not sure how to check for functions in a library that's not in $LIBS
|
|
Packit |
5f9837 |
cu_saved_libs=$LIBS
|
|
Packit |
5f9837 |
LIBS="$LIBS $KRB5_LDADD"
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# determine whether we can use MIT's new 'krb5_auth_con_getsendsubkey' to extract the signing key
|
|
Packit |
5f9837 |
if test $enable_cifsupcall != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_FUNCS([krb5_auth_con_getsendsubkey])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# non-critical functions (we have workarounds for these)
|
|
Packit |
5f9837 |
if test $enable_cifsupcall != "no"; then
|
|
Packit |
5f9837 |
AC_CHECK_FUNCS([krb5_principal_get_realm krb5_free_unparsed_name])
|
|
Packit |
5f9837 |
AC_CHECK_FUNCS([krb5_auth_con_setaddrs krb5_auth_con_set_req_cksumtype])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test $enable_systemd != "no"; then
|
|
Packit |
5f9837 |
AC_DEFINE(ENABLE_SYSTEMD, 1, [Enable systemd specific behavior for mount.cifs])
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# if docs are not disabled, check if rst2man is available
|
|
Packit |
5f9837 |
if test $enable_man != "no"; then
|
|
Packit |
0fc7fb |
AC_CHECK_PROGS(have_rst2man, rst2man-3 rst2man, no)
|
|
Packit |
5f9837 |
if test $have_rst2man = "no"; then
|
|
Packit |
5f9837 |
if test $enable_man = "yes"; then
|
|
Packit |
5f9837 |
AC_MSG_ERROR([rst2man not found: cannot generate man pages, consider installing perl.])
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
AC_MSG_WARN([rst2man not found: cannot generate man pages, consider installing perl. Disabling man page generation.])
|
|
Packit |
5f9837 |
enable_man="no"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
else
|
|
Packit |
5f9837 |
enable_man="yes"
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
# MIT krb5 < 1.7 does not have this declaration but does have the symbol
|
|
Packit |
5f9837 |
AC_CHECK_DECLS(krb5_auth_con_set_req_cksumtype, [], [], [#include <krb5.h>])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
LIBS=$cu_saved_libs
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
AM_CONDITIONAL(CONFIG_MAN, [test "$enable_man" != "no"])
|
|
Packit |
5f9837 |
AM_CONDITIONAL(CONFIG_CIFSUPCALL, [test "$enable_cifsupcall" != "no"])
|
|
Packit |
5f9837 |
AM_CONDITIONAL(CONFIG_CIFSCREDS, [test "$enable_cifscreds" != "no"])
|
|
Packit |
5f9837 |
AM_CONDITIONAL(CONFIG_CIFSIDMAP, [test "$enable_cifsidmap" != "no"])
|
|
Packit |
5f9837 |
AM_CONDITIONAL(CONFIG_CIFSACL, [test "$enable_cifsacl" != "no"])
|
|
Packit |
5f9837 |
AM_CONDITIONAL(CONFIG_PAM, [test "$enable_pam" != "no"])
|
|
Packit |
5f9837 |
AM_CONDITIONAL(CONFIG_PLUGIN, [test "$enable_cifsidmap" != "no" -o "$enable_cifsacl" != "no"])
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
LIBCAP_NG_PATH
|
|
Packit |
5f9837 |
|
|
Packit |
5f9837 |
if test "x$CAPNG_LDADD" = "x"; then
|
|
Packit |
5f9837 |
AC_LIBCAP
|
|
Packit |
5f9837 |
fi
|
|
Packit |
5f9837 |
AC_OUTPUT
|