summaryrefslogtreecommitdiff
path: root/src/external
diff options
context:
space:
mode:
authorOndrej Kos <okos@redhat.com>2013-02-18 14:43:19 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-03-27 20:15:52 +0100
commit539b1be3507abdf8ac235b06eeed5011b0b5cde2 (patch)
treede8f928b6b46a95af9a1a11d6f0f7ba6d72fcc9f /src/external
parent78eba1cdd8e337d07b536afd9d6043482c88208e (diff)
downloadsssd-539b1be3507abdf8ac235b06eeed5011b0b5cde2.tar.gz
sssd-539b1be3507abdf8ac235b06eeed5011b0b5cde2.tar.bz2
sssd-539b1be3507abdf8ac235b06eeed5011b0b5cde2.zip
Provide libnl3 support
https://fedorahosted.org/sssd/ticket/812 Update the monitor code to be using the new libnl3 API. Changed configure option --with-libnl By default, it tries to build with libnl3, if not found, then with libnl1, if this isn't found either, build proceeds without libnl, just with warning. Specifing --with-libnl=<libnl3|libnl1|no> checks for the specific given version, if not found, configure ends with error.
Diffstat (limited to 'src/external')
-rw-r--r--src/external/libnl.m498
1 files changed, 73 insertions, 25 deletions
diff --git a/src/external/libnl.m4 b/src/external/libnl.m4
index 36619ff8..d468a490 100644
--- a/src/external/libnl.m4
+++ b/src/external/libnl.m4
@@ -1,34 +1,82 @@
+dnl A macro to check if this particular version of libnl supports particular common libnl functions
+AC_DEFUN([AM_CHECK_LIBNL_FCS],
+[
+ AC_CHECK_LIB($1,
+ [nl_socket_add_membership],
+ [AC_DEFINE([HAVE_NL_SOCKET_ADD_MEMBERSHIP], 1, [Does libnl have nl_socket_add_membership?])
+ ],
+ )
+
+ AC_CHECK_LIB($1,
+ [nl_socket_modify_cb],
+ [AC_DEFINE([HAVE_NL_SOCKET_MODIFY_CB], 1, [Does libnl have nl_socket_modify_cb?])
+ ],
+ )
+
+ AC_CHECK_LIB($1,
+ [rtnl_route_get_oif],
+ [AC_DEFINE([HAVE_RTNL_ROUTE_GET_OIF], 1, [Does libnl have rtnl_route_get_oif?])
+ ],
+ )
+
+ AC_CHECK_LIB($1,
+ [nl_set_passcred],
+ [AC_DEFINE([HAVE_NL_SET_PASSCRED], 1, [Does libnl have nl_set_passcred?])
+ ],
+ )
+
+ AC_CHECK_LIB($1,
+ [nl_socket_set_passcred],
+ [AC_DEFINE([HAVE_NL_SOCKET_SET_PASSCRED], 1, [Does libnl have nl_socket_set_passcred?])
+ ],
+ )
+])
+
dnl A macro to check the availability and version of libnetlink
+AC_DEFUN([AM_CHECK_LIBNL1],
+[
+ PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.1,[
+
+ HAVE_LIBNL=1
+ HAVE_LIBNL1=1
+
+ AC_DEFINE_UNQUOTED(HAVE_LIBNL, 1, [Build with libnetlink support])
+ AC_DEFINE_UNQUOTED(HAVE_LIBNL1, 1, [Libnetlink version = 1])
+
+ AC_MSG_NOTICE([Building with libnl])
+
+ AC_CHECK_HEADERS(netlink.h)
+ AC_CHECK_LIB(nl, nl_connect, [ LIBNL_LIBS="-lnl" ], [AC_MSG_ERROR([libnl is required])])
-AC_DEFUN([AM_CHECK_LIBNL],
+ AM_CHECK_LIBNL_FCS(nl)
+
+
+ ],[AC_MSG_WARN([Netlink v1 support unavailable or too old])])
+
+ AC_SUBST(LIBNL_CFLAGS)
+ AC_SUBST(LIBNL_LIBS)
+])
+
+dnl A macro to check the availability of libnetlink version 3
+
+AC_DEFUN([AM_CHECK_LIBNL3],
[
- PKG_CHECK_MODULES(libnl, libnl-1 >= 1.1,[
+ PKG_CHECK_MODULES(LIBNL, [
+ libnl-3.0 >= 3.0
+ libnl-route-3.0 >= 3.0], [
+
HAVE_LIBNL=1
- AC_SUBST(HAVE_LIBNL)
+ HAVE_LIBNL3=1
+
+
AC_DEFINE_UNQUOTED(HAVE_LIBNL, 1, [Build with libnetlink support])
+ AC_DEFINE_UNQUOTED(HAVE_LIBNL3, 1, [Libnetlink version = 3])
+
+ AC_MSG_NOTICE([Building with libnl3])
+
+ AM_CHECK_LIBNL_FCS(nl-3)
- AC_CHECK_HEADERS(netlink.h)
- AC_CHECK_LIB(nl, nl_connect, [ LIBNL_LIBS="-lnl" ], [AC_MSG_ERROR([libnl is required])])
-
- dnl Check if this particular version of libnl supports particular functions
- AC_CHECK_LIB([nl],
- [nl_socket_add_membership],
- [AC_DEFINE([HAVE_NL_SOCKET_ADD_MEMBERSHIP], 1, [Does libnl have nl_socket_add_membership?])
- ],
- )
-
- AC_CHECK_LIB([nl],
- [nl_socket_modify_cb],
- [AC_DEFINE([HAVE_NL_SOCKET_MODIFY_CB], 1, [Does libnl have nl_socket_modify_cb?])
- ],
- )
-
- AC_CHECK_LIB([nl],
- [nl_set_passcred],
- [AC_DEFINE([HAVE_NL_SET_PASSCRED], 1, [Does libnl have nl_set_passcred?])
- ],
- )
- ],[AC_MSG_WARN([Netlink support unavailable or too old])])
+ ],[AC_MSG_WARN([Netlink v3 support unavailable or too old])])
AC_SUBST(LIBNL_CFLAGS)
AC_SUBST(LIBNL_LIBS)