summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorŁukasz Stelmach <stlman@poczta.fm>2023-10-15 16:53:02 +0200
committerŁukasz Stelmach <stlman@poczta.fm>2023-10-24 15:00:21 +0200
commitc68a158ffb94b0e3278c67593539062ef4e3f0dd (patch)
treec0cb8c2a3570dfa266f57b5c580224566d7dbe30 /setup.py
parent9108039786d9cca33103a3fbf6adf371b1184a60 (diff)
linux: use pkgconfig to find libacl
Using pkgconfig gives a more meaningful error message in case libacl development files are missing.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index d9c0fee5c..fde8ca005 100644
--- a/setup.py
+++ b/setup.py
@@ -186,6 +186,17 @@ if not on_rtd:
dict(extra_compile_args=cflags),
)
+ if sys.platform == "linux":
+ linux_ext_kwargs = members_appended(
+ dict(sources=[platform_linux_source]),
+ lib_ext_kwargs(pc, "BORG_LIBACL_PREFIX", "acl", "libacl", ">=2.3.1"),
+ dict(extra_compile_args=cflags),
+ )
+ else:
+ linux_ext_kwargs = members_appended(
+ dict(sources=[platform_linux_source], libraries=["acl"], extra_compile_args=cflags),
+ )
+
# note: _chunker.c and _hashindex.c are relatively complex/large pieces of handwritten C code,
# thus we undef NDEBUG for them, so the compiled code will contain and execute assert().
ext_modules += [
@@ -198,7 +209,8 @@ if not on_rtd:
]
posix_ext = Extension("borg.platform.posix", [platform_posix_source], extra_compile_args=cflags)
- linux_ext = Extension("borg.platform.linux", [platform_linux_source], libraries=["acl"], extra_compile_args=cflags)
+ linux_ext = Extension("borg.platform.linux", **linux_ext_kwargs)
+
syncfilerange_ext = Extension(
"borg.platform.syncfilerange", [platform_syncfilerange_source], extra_compile_args=cflags
)