summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2015-09-10 18:44:27 -0700
committerAndy Zhou <azhou@nicira.com>2015-09-30 19:42:25 -0700
commit1bbebfb7afadac4adf209cf7f7ab69655479638b (patch)
tree28a9aef8d4afd73084bbf3264b1efbf5499369cc /m4
parentc28a1f83b1d6028cd3bc7aae6e07bbcc5665e57a (diff)
downloadopenvswitch-1bbebfb7afadac4adf209cf7f7ab69655479638b.tar.gz
configure: add configuration options for libcap-ng
Add configuration option for enabling or disabling linking with libcap-ng. Since capabilities are a security feature, the libcapng option is handled as follows: - no option: use libcapng if it's present --disable-libcapng: do not use libcapng --enable-libcapng: do use libcapng and fail configuration if it's missing On Linux, not linking with libcapng makes all OVS daemons fail when --user option is specified. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/openvswitch.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 98e5ce9be..d3558114c 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -186,6 +186,42 @@ AC_DEFUN([OVS_CHECK_NETLINK],
[Define to 1 if Netlink protocol is available.])
fi])
+dnl Checks for libcap-ng.
+AC_DEFUN([OVS_CHECK_LIBCAPNG],
+ [AC_ARG_ENABLE(
+ [libcapng],
+ [AC_HELP_STRING([--disable-libcapng], [Disable Linux capability support])],
+ [case "${enableval}" in
+ (yes) libcapng=true ;;
+ (no) libcapng=false ;;
+ (*) AC_MSG_ERROR([bad value ${enableval} for --enable-libcapng]) ;;
+ esac],
+ [libcapng=check])
+
+ if test "$libcapng" != false; then
+ AC_CHECK_LIB([cap-ng], [capng_clear], [HAVE_LIBCAPNG=yes])
+
+ if test "$HAVE_LIBCAPNG" != yes; then
+ if test "$libcapng" = true ; then
+ AC_MSG_ERROR([libcap-ng support requested, but not found])
+ fi
+ if test "$libcapng" = check ; then
+ AC_MSG_WARN([cannot find libcap-ng.
+--user option will not be supported on Linux.
+(you may use --disable-libcapng to suppress this warning). ])
+ fi
+ fi
+ fi
+
+ AC_SUBST([HAVE_LIBCAPNG])
+ AM_CONDITIONAL([HAVE_LIBCAPNG], [test "$HAVE_LIBCAPNG" = yes])
+ if test "$HAVE_LIBCAPNG" = yes; then
+ AC_DEFINE([HAVE_LIBCAPNG], [1],
+ [Define to 1 if libcap-ng is available.])
+ CAPNG_LDADD="-lcap-ng"
+ AC_SUBST([CAPNG_LDADD])
+ fi])
+
dnl Checks for OpenSSL.
AC_DEFUN([OVS_CHECK_OPENSSL],
[AC_ARG_ENABLE(