+dnl Determine the system's authentication capabilities, if autologin is
+dnl requested. We currently support PAM, standard getpwnam(), and getspnam()
+dnl (Linux shadow passwords)
+if test "$enable_autologin" != no; then
+ if test "$with_pam" = yes; then
+ save_LIBS=$LIBS
+ AC_CHECK_LIB(pam, pam_start, [chkpwd_LIBS="-lpam $chkpwd_LIBS"
+ LIBS="-lpam $LIBS"])
+ AC_CHECK_FUNCS(pam_start)
+ test "$enable_chkpwd" = yes && LIBS=$save_LIBS
+ fi
+ if test "$ac_cv_func_pam_start" = no -o "$with_pam" != yes; then
+ AC_CHECK_LIB(shadow, getspnam)
+ if test "$ac_cv_func_crypt" = no; then
+ AC_CHECK_LIB(crypt, crypt, [chkpwd_LIBS=-lcrypt
+ test "$enable_chkpwd" != yes && \
+ LIBS="-lcrypt $LIBS"])
+ fi
+ fi
+ if test "$ac_cv_func_crypt" = yes -o "$ac_cv_lib_crypt_crypt" = yes -o "$ac_cv_func_pam_start" = yes; then
+ AC_DEFINE(ENABLE_AUTOLOGIN)
+ if test "$enable_chkpwd" = yes; then
+ AC_DEFINE(ENABLE_CHKPWD)
+ CHKPWD=chkpwd
+ else
+ AUTH=auth.ro
+ fi
+ fi