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: Fix issues with quota support on linux and macOS hosts #1092

Merged
merged 3 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 3 additions & 7 deletions etc/afpd/unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,9 @@
#endif /* ! __svr4__ || HAVE_DQB_BTIMELIMIT */

#if defined(__linux__) || defined(HAVE_QUOTA_H)
#ifndef NEED_QUOTACTL_WRAPPER
/*#include <sys/quota.h>*/
/*long quotactl (int, const char *, unsigned int, caddr_t); */
/* extern long quotactl (int, const char *, long, caddr_t); */

#else /* ! NEED_QUOTACTL_WRAPPER */
#include <asm/types.h>
#include <asm/unistd.h>
#include <linux/quota.h>
#endif /* ! NEED_QUOTACTL_WRAPPER */
#endif /* linux || HAVE_QUOTA_H */

#ifdef __svr4__
Expand All @@ -70,6 +63,9 @@
#include <ufs/ufs/quota.h>
#include <ufs/ufs/quota1.h>
#include <ufs/ufs/quota2.h>
#elif defined(__APPLE__)
#include <sys/quota.h>
#define dqb_curblocks dqb_curbytes
#else /* DragonFly */
#include <ufs/ufs/quota.h>
#endif /* DragonFly */
Expand Down
3 changes: 2 additions & 1 deletion libatalk/compat/rquota_xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
/* list of machines that don't have these functions:
solaris
linux libc5
macOS
*/
#if defined(NEED_RQUOTA) || defined(SOLARIS) || (defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 6)
#if defined(NEED_RQUOTA) || defined(SOLARIS) || (defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 6) || defined(__APPLE__)

#include <rpcsvc/rquota.h>

Expand Down
7 changes: 2 additions & 5 deletions libatalk/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ subdir('acl')
subdir('adouble')
subdir('bstring')
subdir('cnid')
subdir('compat')
subdir('dsi')
subdir('iniparser')
subdir('util')
Expand All @@ -12,11 +13,6 @@ libatalk_deps = []
libatalk_libs = []
libatalk_sources = []

if host_os != 'darwin'
subdir('compat')
libatalk_libs += libcompat
endif

if have_acls
libatalk_deps += acl_deps
endif
Expand Down Expand Up @@ -47,6 +43,7 @@ libatalk = both_libraries(
libatalk_libs,
libbstring,
libcnid,
libcompat,
libdsi,
libiniparser,
libunicode,
Expand Down
8 changes: 4 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1904,16 +1904,14 @@ endif
# OS-specific configuration
#

if host_os.contains('darwin')
cdata.set('NO_QUOTA_SUPPORT', 1)
elif host_os.contains('freebsd')
if host_os.contains('freebsd')
cdata.set('BSD4_4', 1)
cdata.set('FREEBSD', 1)
cdata.set('OPEN_NOFOLLOW_ERRNO', 'EMLINK')
elif host_os.contains('linux')
cdata.set('_GNU_SOURCE', 1)
cdata.set('HAVE_BROKEN_DBTOB', 1)
cdata.set('LINUX', 1)
cdata.set('NO_QUOTA_SUPPORT', 1)
elif host_os.contains('netbsd')
cdata.set('BSD4_4', 1)
cdata.set('NETBSD', 1)
Expand All @@ -1929,6 +1927,8 @@ elif host_os.contains('sunos')
cdata.set('_XOPEN_SOURCE', 600)
cdata.set('NO_STRUCT_TM_GMTOFF', 1)
cdata.set('SOLARIS', 1)
elif host_os.contains('darwin')
cdata.set('HAVE_BROKEN_DBTOB', 1)
endif

#
Expand Down
3 changes: 3 additions & 0 deletions meson_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
/* Define to 1 if you have the `backtrace_symbols' function. */
#mesondefine HAVE_BACKTRACE_SYMBOLS

/* Define to 1 if dbtob implementation is broken. */
#mesondefine HAVE_BROKEN_DBTOB

/* Define to 1 if you have the <crypt.h> header file. */
#mesondefine HAVE_CRYPT_H

Expand Down
Loading