mc-mcserver.m4 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. dnl MC_MCSERVER_CHECKS
  2. dnl Check how mcserver should check passwords.
  3. dnl Possible methods are PAM, pwdauth and crypt.
  4. dnl The later works with both /etc/shadow and /etc/passwd.
  5. dnl If PAM is found, other methods are not checked.
  6. AC_DEFUN([MC_MCSERVER_CHECKS], [
  7. dnl
  8. dnl mcfs support
  9. dnl
  10. AC_ARG_ENABLE([mcserver],
  11. [ --enable-mcserver Support mc-specific networking file system server [[no]]],
  12. [if test "x$enableval" != "xno"; then
  13. AC_DEFINE(ENABLE_MCSERVER, 1, [Define to enable mc-specific networking file system server])
  14. AC_MC_VFS_ADDNAME([mcfs])
  15. enable_mcserver=yes
  16. fi]
  17. )
  18. if test x"$enable_mcserver" = "xyes"; then
  19. AC_MC_VFS_MCFS_SET
  20. dnl Check if PAM can be used for mcserv
  21. AC_CHECK_LIB(dl, dlopen, [LIB_DL="-ldl"])
  22. AC_CHECK_LIB(pam, pam_start, [
  23. AC_DEFINE(HAVE_PAM, 1,
  24. [Define if PAM (Pluggable Authentication Modules) is available])
  25. MCSERVLIBS="-lpam $LIB_DL"
  26. mcserv_pam=yes], [], [$LIB_DL])
  27. dnl Check for crypt() - needed for both /etc/shadow and /etc/passwd.
  28. if test x"$mcserv_pam" = x; then
  29. dnl Check for pwdauth() - used on SunOS.
  30. AC_CHECK_FUNCS([pwdauth])
  31. dnl Check for crypt()
  32. AC_CHECK_HEADERS([crypt.h], [crypt_header=yes])
  33. if test -n "$crypt_header"; then
  34. save_LIBS="$LIBS"
  35. LIBS=
  36. AC_SEARCH_LIBS(crypt, [crypt crypt_i], [mcserv_auth=crypt])
  37. MCSERVLIBS="$LIBS"
  38. LIBS="$save_LIBS"
  39. if test -n "$mcserv_auth"; then
  40. AC_DEFINE(HAVE_CRYPT, 1,
  41. [Define to use crypt function in mcserv])
  42. dnl Check for shadow passwords
  43. AC_CHECK_HEADERS([shadow.h shadow/shadow.h],
  44. [shadow_header=yes; break])
  45. if test -n "$shadow_header"; then
  46. save_LIBS="$LIBS"
  47. LIBS="$MCSERVLIBS"
  48. AC_SEARCH_LIBS(getspnam, [shadow], [mcserv_auth=shadow])
  49. MCSERVLIBS="$LIBS"
  50. LIBS="$save_LIBS"
  51. if test -n "$mcserv_auth"; then
  52. AC_DEFINE(HAVE_SHADOW, 1,
  53. [Define to use shadow passwords for mcserv])
  54. fi
  55. fi
  56. fi
  57. fi
  58. fi
  59. fi
  60. AC_SUBST(MCSERVLIBS)
  61. ])