@@ -167,12 +167,12 @@ try_both_argument()
167
167
}
168
168
169
169
# Test if the specifced library could be used.
170
- # NOTE : This function will return failure if library is missing, use try_optional_pkgconfig_dependency()
171
- # when library is not required .
172
- # $1 - variable name for passing library linking flags
173
- # $2 - variable name for passing library compiler flags (include directiories etc.)
174
- # $3 - library name
175
- # $4 (Optional) - minimum required version based on pkg-config syntax for version checking.
170
+ # Note : This function will return failure if library is missing, ( use try_optional_pkg_dependency
171
+ # instead, to avoid errorring out) .
172
+ # $1 - variable name for passing library linking flags
173
+ # $2 - variable name for passing library compiler flags (include directiories etc.)
174
+ # $3 - library name
175
+ # $4 (Optional) - minimum required version based on pkg-config syntax for version checking.
176
176
try_pkgconfig_dependency ()
177
177
{
178
178
info Checking whether the " $3 " could be used...
@@ -204,11 +204,11 @@ try_pkgconfig_dependency()
204
204
}
205
205
206
206
# Test if the specifced library could be used but disable a feature instead of failing out.
207
- # $1 - variable name for setting 1 or 0 based on library availablity
208
- # $2 - variable name for passing library linking flags
209
- # $3 - variable name for passing library compiler flags (include directiories etc.)
210
- # $4 - library name
211
- # $5 (Optional) - minimum required version based on pkg-config syntax for version checking.
207
+ # $1 - variable name for setting 1 or 0 based on library availablity
208
+ # $2 - variable name for passing library linking flags
209
+ # $3 - variable name for passing library compiler flags (include directiories etc.)
210
+ # $4 - library name
211
+ # $5 (Optional) - minimum required version based on pkg-config syntax for version checking.
212
212
try_optional_pkgconfig_dependency ()
213
213
{
214
214
if try_pkgconfig_dependency " $2 " " $3 " " $4 " " ${5:- } " ; then
@@ -258,6 +258,8 @@ Build and configuration options:
258
258
--disable-cgroups Disable Cgroups support
259
259
--enable-capabilities Enable capabilities support
260
260
[Enabled on Linux if libcap available]
261
+ --enable-capabilties=pkg-config Enable capabilities support after checking libcap availablity
262
+ with pkg-config
261
263
--disable-capabilities Disable capabilities support
262
264
--enable-ioprio Enable support for I/O priority setting (via Linux API)
263
265
[Disabled]
@@ -374,6 +376,7 @@ for arg in "$@"; do
374
376
--enable-cgroups|--enable-cgroups=yes) SUPPORT_CGROUPS=1 ;;
375
377
--disable-cgroups|--enable-cgroups=no) SUPPORT_CGROUPS=0 ;;
376
378
--enable-capabilities|--enable-capabilities=yes) SUPPORT_CAPABILITIES=1 ;;
379
+ --enable-capabilities=pkg-config) SUPPORT_CAPABILITIES=pkg-config ;;
377
380
--disable-capabilities|--enable-capabilities=no) SUPPORT_CAPABILITIES=0 ;;
378
381
--enable-ioprio|--enable-ioprio=yes) SUPPORT_IOPRIO=1 ;;
379
382
--disable-ioprio|--enable-ioprio=no) SUPPORT_IOPRIO=0 ;;
541
544
if [ " $AUTO_LDFLAGS_BASE " = true ] && [ " $PLATFORM " = FreeBSD ]; then
542
545
try_ld_argument LDFLAGS_BASE -lrt
543
546
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
545
550
if [ " $AUTO_LDFLAGS_LIBCAP " = true ]; then
546
551
try_ld_argument LDFLAGS_LIBCAP -lcap
547
552
if [ " $SUPPORT_CAPABILITIES " = AUTO ]; then
0 commit comments