Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: Improved libquota detection on FreeBSD and NetBSD #1805

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 35 additions & 32 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1012,40 +1012,43 @@ endif
if not enable_quota
have_quota = false
cdata.set('NO_QUOTA_SUPPORT', 1)
else
have_quota = tirpc.found() and cc.has_header('rpcsvc/rquota.h')
if have_quota
cdata.set('NEED_RQUOTA', 1)
quota_deps += tirpc
quota_provider += 'libtirpc'
if cc.compiles(
'''
#include <rpcsvc/rquota.h>
int main(void) {
enum qr_status foo;
foo = Q_OK;
return 0;
}
''',
dependencies: tirpc,
elif quota.found() and cc.has_function('quota_open')
# FreeBSD provides libquota API in libc
have_libquota = true
have_quota = true
quota_provider += 'libquota'
cdata.set('HAVE_LIBQUOTA', 1)
elif quota.found() and cc.has_function('quota_open', dependencies: [quota, prop])
have_libquota = true
have_quota = true
quota_provider += 'libquota'
quota_deps += [quota, prop]
cdata.set('HAVE_LIBQUOTA', 1)
elif tirpc.found() and cc.has_header('rpcsvc/rquota.h')
cdata.set('NEED_RQUOTA', 1)
quota_deps += tirpc
quota_provider += 'libtirpc'
if cc.compiles(
'''
#include <rpcsvc/rquota.h>
int main(void) {
enum qr_status foo;
foo = Q_OK;
return 0;
}
''',
dependencies: tirpc,
)
cdata.set('HAVE_RQUOTA_H_QR_STATUS', 1)
endif
else
have_quota = rpcsvc.found() and rpc_headers_ok
if have_quota
quota_deps += rpcsvc
quota_provider += 'SunRPC'
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
else
have_quota = false
cdata.set('NO_QUOTA_SUPPORT', 1)
endif
cdata.set('HAVE_RQUOTA_H_QR_STATUS', 1)
endif
have_quota = true
elif rpcsvc.found() and rpc_headers_ok
quota_deps += rpcsvc
quota_provider += 'SunRPC'
have_quota = true
else
have_quota = false
cdata.set('NO_QUOTA_SUPPORT', 1)
endif

if enable_quota and not have_quota
Expand Down
Loading