diff --git a/etc/afpd/meson.build b/etc/afpd/meson.build index 0af0b6288f..d65126771d 100644 --- a/etc/afpd/meson.build +++ b/etc/afpd/meson.build @@ -73,9 +73,13 @@ endif if have_quota afpd_sources += [ - 'nfsquota.c', 'quota.c', ] + if not have_libquota + afpd_sources += [ + 'nfsquota.c', + ] + endif afpd_external_deps += quota_deps endif diff --git a/etc/afpd/quota.c b/etc/afpd/quota.c index 1b7576d73b..8538bb7880 100644 --- a/etc/afpd/quota.c +++ b/etc/afpd/quota.c @@ -32,6 +32,7 @@ #include #include "auth.h" +#include "directory.h" #include "volume.h" #include "unix.h" diff --git a/meson.build b/meson.build index de2ca67457..a63a221864 100644 --- a/meson.build +++ b/meson.build @@ -971,6 +971,7 @@ tirpc = dependency('libtirpc', required: false) quota_deps = [] quota_provider = '' +have_libquota = false rpc_headers = [ 'rpc/rpc.h', @@ -1017,7 +1018,8 @@ else if have_quota quota_deps += rpcsvc quota_provider += 'SunRPC' - if quota.found() and cc.has_function('getfsquota', dependencies: [quota, prop, rpcsvc]) + if quota.found() and cc.has_function('quota_open', dependencies: [quota, prop, rpcsvc]) + have_libquota = true quota_deps += [quota, prop] cdata.set('HAVE_LIBQUOTA', 1) endif diff --git a/test/afpd/meson.build b/test/afpd/meson.build index afbab5c699..43926f0c96 100644 --- a/test/afpd/meson.build +++ b/test/afpd/meson.build @@ -56,9 +56,13 @@ endif if have_quota test_sources += [ - meson.project_source_root() / 'etc/afpd/nfsquota.c', meson.project_source_root() / 'etc/afpd/quota.c', ] + if not have_libquota + test_sources += [ + meson.project_source_root() / 'etc/afpd/nfsquota.c', + ] + endif test_external_deps += quota_deps endif