Skip to content

Commit

Permalink
meson: Check for SunRPC function quota_open(), GitHub #1225
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Nov 23, 2024
1 parent c6b7293 commit e9b6ea1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion etc/afpd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions etc/afpd/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <atalk/util.h>

#include "auth.h"
#include "directory.h"
#include "volume.h"
#include "unix.h"

Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ tirpc = dependency('libtirpc', required: false)

quota_deps = []
quota_provider = ''
have_libquota = false

rpc_headers = [
'rpc/rpc.h',
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion test/afpd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e9b6ea1

Please sign in to comment.