if test "x$use_caps" != "xno"; then
# cap_clear_flag is the most recent libcap function we require
AC_CHECK_LIB(cap, cap_clear_flag)
- if test "x$ac_cv_lib_cap_cap_clear_flag" != xyes
+ if test "x$ac_cv_lib_cap_cap_clear_flag" != xyes; then
if test "x$use_caps" = "xyes"; then
- AC_MSG_ERROR("libcap forced enabled but not available or not usable, requires libcap-2.09 or later")
+ AC_MSG_ERROR([libcap forced enabled but not available or not usable, requires libcap-2.09 or later])
fi
use_caps=no
fi
AC_DEFINE(USE_LIBCAP, 1, [use libcap to set capabilities required for TPROXY])
dnl Check for libcap headader breakage.
AC_CHECK_HEADERS(sys/capability.h)
- AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_libcap_broken,
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/capability.h>]], [[
- capget(NULL, NULL);
- capset(NULL, NULL);
- ]])],[squid_cv_libcap_broken=0],[squid_cv_libcap_broken=1])
+ AC_CACHE_CHECK([for operational libcap2 headers], squid_cv_sys_capability_works,
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#include <stddef.h>
+#include <sys/capability.h>
+]], [[
+capget(NULL, NULL);
+capset(NULL, NULL);
+ ]])],[squid_cv_sys_capability_works=yes],[squid_cv_sys_capability_works=no])
)
- AC_DEFINE_UNQUOTED([LIBCAP_BROKEN],$squid_cv_libcap_broken,[if libcap2 headers are broken and clashing with glibc])
+ if test x$squid_cv_sys_capability_works != xyes; then
+ AC_DEFINE([LIBCAP_BROKEN],1,[if libcap2 headers are broken and clashing with glibc])
+ fi
fi