1 # libcap-ng.m4 - Checks for the libcap-ng support
2 # Copyright (c) 2009 Steve Grubb sgrubb@redhat.com
4 AC_DEFUN([LIBCAP_NG_PATH],
7 [ --with-libcap-ng=[auto/yes/no] Add Libcap-ng support [default=auto]],,
10 # Check for Libcap-ng API
14 if test x$with_libcap_ng = xno ; then
17 # Start by checking for header file
18 AC_CHECK_HEADER(cap-ng.h, capng_headers=yes, capng_headers=no)
20 # See if we have libcap-ng library
21 AC_CHECK_LIB(cap-ng, capng_clear,
22 CAPNG_LDADD=-lcap-ng,)
24 # Check results are usable
25 if test x$with_libcap_ng = xyes -a x$CAPNG_LDADD = x ; then
26 AC_MSG_ERROR(libcap-ng support was requested and the library was not found)
28 if test x$CAPNG_LDADD != x -a $capng_headers = no ; then
29 AC_MSG_ERROR(libcap-ng libraries found but headers are missing)
33 AC_MSG_CHECKING(whether to use libcap-ng)
34 if test x$CAPNG_LDADD != x ; then
35 AC_DEFINE(HAVE_LIBCAP_NG,1,[libcap-ng support])