$NetBSD: patch-af,v 1.31.16.1 2016/01/26 19:52:04 bsiegert Exp $

* Add "--with-nbsdops" option, NetBSD standard options.
* Link with util(3) in the case of DragonFly, too.
* When specified "--with-kerb5" option, test existence of several functions
  even if there is krb5-config.  krb5-config dosen't give all definitions for
  functions (HAVE_KRB5_*).
* Remove setting sysconfdir to "/etc".

--- configure.ac.orig	2015-10-31 23:35:24.000000000 +0000
+++ configure.ac
@@ -434,6 +434,20 @@ AC_ARG_WITH(csops, [AS_HELP_STRING([--wi
 		;;
 esac])
 
++AC_ARG_WITH(nbsdops, [AS_HELP_STRING([--with-nbsdops], [add NetBSD standard opt
+ions])],
+[case $with_nbsdops in
+    yes)       echo 'Adding NetBSD standard options'
+               CHECKSIA=false
+               with_ignore_dot=yes
+               with_env_editor=yes
+               with_tty_tickets=yes
+               ;;
+    no)                ;;
+    *)         echo "Ignoring unknown argument to --with-nbsdops: $with_nbsdops"
+               ;;
+esac])
+
 AC_ARG_WITH(passwd, [AS_HELP_STRING([--without-passwd], [don't use passwd/shadow file for authentication])],
 [case $with_passwd in
     yes|no)	AC_MSG_CHECKING(whether to use shadow/passwd file authentication)
@@ -1938,7 +1952,7 @@ case "$host" in
 		: ${mansectsu='1m'}
 		: ${mansectform='4'}
 		;;
-    *-*-linux*|*-*-k*bsd*-gnu)
+    *-*-linux*|*-*-k*bsd*-gnu|*-*-gnukfreebsd)
 		shadow_funcs="getspnam"
 		test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
 		;;
@@ -2286,7 +2300,7 @@ SUDO_MAILDIR
 if test ${with_logincap-'no'} != "no"; then
     AC_CHECK_HEADERS([login_cap.h], [LOGINCAP_USAGE='[[-c class]] '; LCMAN=1
 	case "$OS" in
-	    freebsd|netbsd)
+	    dragonfly*|freebsd|netbsd)
 		SUDO_LIBS="${SUDO_LIBS} -lutil"
 		SUDOERS_LIBS="${SUDOERS_LIBS} -lutil"
 		;;
@@ -3374,6 +3388,8 @@ if test ${with_kerb5-'no'} != "no"; then
 	])
 	AUTH_OBJS="$AUTH_OBJS kerb5.lo"
     fi
+fi
+if test ${with_kerb5-'no'} != "no"; then
     _LIBS="$LIBS"
     LIBS="${LIBS} ${SUDOERS_LIBS}"
     AC_CHECK_FUNCS([krb5_verify_user krb5_init_secure_context])
@@ -4167,7 +4183,7 @@ test "$datarootdir" = '${prefix}/share' 
 test "$docdir" = '${datarootdir}/doc/${PACKAGE_TARNAME}' && docdir='$(datarootdir)/doc/$(PACKAGE_TARNAME)'
 test "$localedir" = '${datarootdir}/locale' && localedir='$(datarootdir)/locale'
 test "$localstatedir" = '${prefix}/var' && localstatedir='$(prefix)/var'
-test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc'
+dnl test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc'
 
 dnl
 dnl Substitute into the Makefile and man pages
