Skip to content

Commit 6abe16a

Browse files
committed
configure: add libcap dependency query through pkg-config
Check new --enable-capabilities=pkg-config option.
1 parent 08d44cc commit 6abe16a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

configure

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ Build and configuration options:
258258
--disable-cgroups Disable Cgroups support
259259
--enable-capabilities Enable capabilities support
260260
[Enabled on Linux if libcap available]
261+
--enable-capabilties=pkg-config Enable capabilities support after checking libcap availablity
262+
with pkg-config
261263
--disable-capabilities Disable capabilities support
262264
--enable-ioprio Enable support for I/O priority setting (via Linux API)
263265
[Disabled]
@@ -374,6 +376,7 @@ for arg in "$@"; do
374376
--enable-cgroups|--enable-cgroups=yes) SUPPORT_CGROUPS=1 ;;
375377
--disable-cgroups|--enable-cgroups=no) SUPPORT_CGROUPS=0 ;;
376378
--enable-capabilities|--enable-capabilities=yes) SUPPORT_CAPABILITIES=1 ;;
379+
--enable-capabilities=pkg-config) SUPPORT_CAPABILITIES=pkg-config ;;
377380
--disable-capabilities|--enable-capabilities=no) SUPPORT_CAPABILITIES=0 ;;
378381
--enable-ioprio|--enable-ioprio=yes) SUPPORT_IOPRIO=1 ;;
379382
--disable-ioprio|--enable-ioprio=no) SUPPORT_IOPRIO=0 ;;
@@ -541,7 +544,9 @@ fi
541544
if [ "$AUTO_LDFLAGS_BASE" = true ] && [ "$PLATFORM" = FreeBSD ]; then
542545
try_ld_argument LDFLAGS_BASE -lrt
543546
fi
544-
if [ "$SUPPORT_CAPABILITIES" != 0 ]; then
547+
if [ "$SUPPORT_CAPABILITIES" = "pkg-config" ]; then
548+
try_optional_pkgconfig_dependency SUPPORT_CAPABILITIES LDFLAGS_LIBCAP CXXFLAGS libcap
549+
elif [ "$SUPPORT_CAPABILITIES" != 0 ]; then
545550
if [ "$AUTO_LDFLAGS_LIBCAP" = true ]; then
546551
try_ld_argument LDFLAGS_LIBCAP -lcap
547552
if [ "$SUPPORT_CAPABILITIES" = AUTO ]; then

0 commit comments

Comments
 (0)