1dnl SPDX-License-Identifier: GPL-2.0-or-later 2dnl Copyright (c) Cisco Systems Inc., 2009 3dnl Copyright (c) Linux Test Project, 2019 4dnl Author: Ngie Cooper <yaneurabeya@gmail.com> 5 6AC_DEFUN([LTP_CHECK_CAPABILITY_SUPPORT],[ 7AH_TEMPLATE(HAVE_LIBCAP, 8[Define to 1 if you have libcap-2 installed.]) 9AC_CHECK_HEADERS([sys/capability.h],[capability_header_prefix="sys"]) 10if test "x$capability_header_prefix" != x; then 11 AC_CHECK_LIB(cap,cap_compare,[cap_libs="-lcap"]) 12fi 13if test "x$cap_libs" != x; then 14 AC_DEFINE(HAVE_LIBCAP) 15fi 16AC_SUBST(CAP_LIBS,$cap_libs) 17 18AH_TEMPLATE(HAVE_NEWER_LIBCAP, 19[Define to 1 if you have newer libcap-2 installed.]) 20AC_COMPILE_IFELSE([AC_LANG_SOURCE([ 21#include <sys/capability.h> 22#include <linux/types.h> 23int main(void) { 24 __u16 a; 25 __u32 b; 26 return 0; 27}])],[has_newer_libcap="yes"]) 28 29if test "x$has_newer_libcap" = xyes; then 30 AC_DEFINE(HAVE_NEWER_LIBCAP) 31fi 32]) 33