Skip to content

Commit 4d75489

Browse files
committed
meson: Check for SunRPC function quota_open(), GitHub #1225
1 parent 63ea66e commit 4d75489

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

etc/afpd/meson.build

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ endif
7373

7474
if have_quota
7575
afpd_sources += [
76-
'nfsquota.c',
7776
'quota.c',
7877
]
78+
if not have_libquota
79+
afpd_sources += [
80+
'nfsquota.c',
81+
]
82+
endif
7983
afpd_external_deps += quota_deps
8084
endif
8185

etc/afpd/quota.c

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <atalk/util.h>
3333

3434
#include "auth.h"
35+
#include "directory.h"
3536
#include "volume.h"
3637
#include "unix.h"
3738

meson.build

+3-1
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,7 @@ tirpc = dependency('libtirpc', required: false)
977977

978978
quota_deps = []
979979
quota_provider = ''
980+
have_libquota = false
980981

981982
rpc_headers = [
982983
'rpc/rpc.h',
@@ -1023,7 +1024,8 @@ else
10231024
if have_quota
10241025
quota_deps += rpcsvc
10251026
quota_provider += 'SunRPC'
1026-
if quota.found() and cc.has_function('getfsquota', dependencies: [quota, prop, rpcsvc])
1027+
if quota.found() and cc.has_function('quota_open', dependencies: [quota, prop, rpcsvc])
1028+
have_libquota = true
10271029
quota_deps += [quota, prop]
10281030
cdata.set('HAVE_LIBQUOTA', 1)
10291031
endif

test/afpd/meson.build

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ endif
5656

5757
if have_quota
5858
test_sources += [
59-
meson.project_source_root() / 'etc/afpd/nfsquota.c',
6059
meson.project_source_root() / 'etc/afpd/quota.c',
6160
]
61+
if not have_libquota
62+
test_sources += [
63+
meson.project_source_root() / 'etc/afpd/nfsquota.c',
64+
]
65+
endif
6266
test_external_deps += quota_deps
6367
endif
6468

0 commit comments

Comments
 (0)