blob: 410417e6f08a9fa7c43981b0499391eaa28734d3 [file] [log] [blame]
yaberauneyaef772532009-10-09 17:55:43 +00001dnl
2dnl Copyright (c) Cisco Systems Inc., 2009
Garrett Cooper183c6e42010-11-01 22:22:45 -07003dnl Copyright (c) Linux Test Project, 2010
yaberauneyaef772532009-10-09 17:55:43 +00004dnl
5dnl This program is free software; you can redistribute it and/or modify
6dnl it under the terms of the GNU General Public License as published by
7dnl the Free Software Foundation; either version 2 of the License, or
8dnl (at your option) any later version.
9dnl
10dnl This program is distributed in the hope that it will be useful,
11dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13dnl the GNU General Public License for more details.
14dnl
15dnl You should have received a copy of the GNU General Public License
16dnl along with this program; if not, write to the Free Software
17dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18dnl
19dnl Author: Garrett Cooper <yanegomi@gmail.com>
20dnl
21
22dnl
23dnl LTP_CHECK_CAPABILITY_SUPPORT
24dnl ----------------------------
25dnl
26AC_DEFUN([LTP_CHECK_CAPABILITY_SUPPORT],[
Rishikesh K Rajak6e3dd832010-03-22 12:04:09 +053027AH_TEMPLATE(HAVE_LIBCAP,
28[Define to 1 if you have libcap-2 installed.])
Garrett Cooper091fbdc2010-11-08 11:36:32 -080029AC_CHECK_HEADERS([sys/capability.h],[capability_header_prefix="sys"])
Garrett Cooper183c6e42010-11-01 22:22:45 -070030if test "x$capability_header_prefix" != x; then
31 AC_CHECK_LIB(cap,cap_compare,[cap_libs="-lcap"])
32 AC_CHECK_PROG(CAPSET,capset,capset)
33fi
34if test "x$cap_libs" != x; then
35 AC_DEFINE(HAVE_LIBCAP)
Garrett Cooper4f71cae2010-11-01 21:09:17 -070036fi
37AC_SUBST(CAP_LIBS,$cap_libs)
Garrett Cooper4f71cae2010-11-01 21:09:17 -070038])