]> arthur.barton.de Git - netatalk.git/commitdiff
Check for struct if_dqblk. [Bjoern]
authorsrittau <srittau>
Sun, 28 Dec 2003 13:42:06 +0000 (13:42 +0000)
committersrittau <srittau>
Sun, 28 Dec 2003 13:42:06 +0000 (13:42 +0000)
macros/quota-check.m4

index ae9ffa5763ebad181e143242566f089d34f401b8..b13ced7751d5425008f3e6c4f173209c3a7c773a 100644 (file)
@@ -1,6 +1,6 @@
-dnl $Id: quota-check.m4,v 1.3 2003-12-15 04:59:45 srittau Exp $
+dnl $Id: quota-check.m4,v 1.4 2003-12-28 13:42:06 srittau Exp $
 dnl Autoconf macro to check for quota support
-dnl FIXME: This is in now way complete.
+dnl FIXME: This is in no way complete.
 
 AC_DEFUN([AC_CHECK_QUOTA], [
        AC_CHECK_HEADERS(sys/quota.h ufs/quota.h)
@@ -8,5 +8,28 @@ AC_DEFUN([AC_CHECK_QUOTA], [
        QUOTA_LIBS=
        AC_CHECK_LIB(rpcsvc, main, [QUOTA_LIBS=-lrpcsvc])
        AC_SUBST(QUOTA_LIBS)
-])
 
+       dnl ----- Linux 2.6 changed the quota interface
+       ac_have_struct_if_dqblk=no
+       AC_MSG_CHECKING([for struct if_dqblk])
+       AC_COMPILE_IFELSE([
+#include <asm/types.h>
+#include <sys/types.h>
+#include <linux/quota.h>
+
+int main() {
+       struct if_dqblk foo;
+
+       return 0;
+}
+       ], [
+               ac_have_struct_if_dqblk=yes
+               AC_MSG_RESULT([yes])
+       ], [
+               AC_MSG_RESULT([no])
+       ])
+
+       if test "x$ac_have_struct_if_dqblk" = "xyes"; then
+               AC_DEFINE(HAVE_STRUCT_IF_DQBLK, 1, [set if struct if_dqblk exists])
+       fi
+])