diff options
author | Jeff Layton <jlayton@samba.org> | 2010-04-06 15:45:00 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2010-04-06 15:45:00 -0400 |
commit | c3fb3cb1376065734f1b238843d9614d1b9631f0 (patch) | |
tree | f13678550d10c026bd44c52a1e59587c5e139e57 /aclocal/libcap.m4 | |
parent | cad70a330c0f8db02af112d42be0b645b0ceaba2 (diff) | |
download | cifs-utils-c3fb3cb1376065734f1b238843d9614d1b9631f0.tar.gz cifs-utils-c3fb3cb1376065734f1b238843d9614d1b9631f0.tar.bz2 cifs-utils-c3fb3cb1376065734f1b238843d9614d1b9631f0.zip |
autotools: add --with-libcap autoconf option
...it's rather confusing since we can compile against libcap or libcap-ng
but this is helpful for testing.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'aclocal/libcap.m4')
-rw-r--r-- | aclocal/libcap.m4 | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/aclocal/libcap.m4 b/aclocal/libcap.m4 index 0b42689..be32feb 100644 --- a/aclocal/libcap.m4 +++ b/aclocal/libcap.m4 @@ -2,14 +2,29 @@ dnl Checks for libcap.so dnl AC_DEFUN([AC_LIBCAP], [ - dnl look for prctl - AC_CHECK_FUNC([prctl], , ) + AC_ARG_WITH(libcap, + [ --with-libcap Add libcap support [default=yes, if libcap-ng not available]],, + with_libcap=auto) - dnl look for the library; do not add to LIBS if found - AC_CHECK_LIB([cap], [cap_get_proc], enable_libcap="yes", enable_libcap="no", ) + if test "x$with_libcap" = "xno"; then + enable_libcap="no" + else + dnl look for prctl + AC_CHECK_FUNC([prctl], , ) - AC_CHECK_HEADERS([sys/capability.h], , - [AC_MSG_WARN([libcap headers not found. mount.cifs will be built without support for dropping capabilities. Consider installing libcap-devel.]) ; enable_libcap="no"]) + dnl look for the library; do not add to LIBS if found + AC_CHECK_LIB([cap], [cap_get_proc], enable_libcap="yes", enable_libcap="no", ) + + AC_CHECK_HEADERS([sys/capability.h], , + [ + if test x$with_libcap = xyes; then + AC_MSG_ERROR([libcap headers not found]) + else + AC_MSG_WARN([libcap headers not found. mount.cifs will be built without support for dropping capabilities. Consider installing libcap-devel.]) + enable_libcap="no" + fi + ]) + fi if test "$enable_libcap" = "yes"; then AC_DEFINE([HAVE_LIBCAP],[1], [Define if libcap exists]) |