$NetBSD: patch-ao,v 1.3 2012/04/08 05:11:13 dholland Exp $

- support netbsd-6 libquota API
- support dragonfly quotas

caution: the dragonfly patch isn't in the configure.in patch; don't regen
this patch without thinking.

--- configure.orig	2001-11-29 23:54:27.000000000 +0000
+++ configure
@@ -5223,7 +5223,7 @@ EOF
 fi
 if test $quota != no; then
 
-for ac_header in sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h
+for ac_header in quota.h sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:5229: checking for $ac_header" >&5
@@ -5271,8 +5271,11 @@ EOF
 fi
 done
 
-	if test $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o $ac_cv_header_ufs_ufs_quota_h = yes -o $ac_cv_header_linux_quota_h = yes; then
+	if test $ac_cv_header_quota.h = yes -o $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o $ac_cv_header_ufs_ufs_quota_h = yes -o $ac_cv_header_linux_quota_h = yes; then
 		quota=yes
+		if test $ac_cv_header_quota_h = yes; then
+			LIBS="$LIBS -lquota"
+		fi
 	else
 		if test $quota = yes; then
 			{ echo "$as_me:5278: WARNING: QUOTA not supported by OS - disabled" >&5
@@ -5333,6 +5336,12 @@ echo $ECHO_N "checking whether quota sup
 #ifdef HAVE_UFS_UFS_QUOTA_H
 #include <ufs/ufs/quota.h>
 #endif
+#if defined(__DragonFly__)
+# include <sys/param.h>
+# if __DragonFly_version >= 160000
+#  define dqblk ufs_dqblk
+# endif
+#endif
 struct dqblk quota;
 int
 main ()
