]> arthur.barton.de Git - netatalk.git/blob - macros/quota-check.m4
Check for struct if_dqblk. [Bjoern]
[netatalk.git] / macros / quota-check.m4
1 dnl $Id: quota-check.m4,v 1.4 2003-12-28 13:42:06 srittau Exp $
2 dnl Autoconf macro to check for quota support
3 dnl FIXME: This is in no way complete.
4
5 AC_DEFUN([AC_CHECK_QUOTA], [
6         AC_CHECK_HEADERS(sys/quota.h ufs/quota.h)
7
8         QUOTA_LIBS=
9         AC_CHECK_LIB(rpcsvc, main, [QUOTA_LIBS=-lrpcsvc])
10         AC_SUBST(QUOTA_LIBS)
11
12         dnl ----- Linux 2.6 changed the quota interface
13         ac_have_struct_if_dqblk=no
14         AC_MSG_CHECKING([for struct if_dqblk])
15         AC_COMPILE_IFELSE([
16 #include <asm/types.h>
17 #include <sys/types.h>
18 #include <linux/quota.h>
19
20 int main() {
21         struct if_dqblk foo;
22
23         return 0;
24 }
25         ], [
26                 ac_have_struct_if_dqblk=yes
27                 AC_MSG_RESULT([yes])
28         ], [
29                 AC_MSG_RESULT([no])
30         ])
31
32         if test "x$ac_have_struct_if_dqblk" = "xyes"; then
33                 AC_DEFINE(HAVE_STRUCT_IF_DQBLK, 1, [set if struct if_dqblk exists])
34         fi
35 ])