build: Add support for building with libnl-3.0
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Tue, 15 May 2012 22:20:00 +0000 (19:20 -0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 16 May 2012 23:20:56 +0000 (01:20 +0200)
libnl-3.0 has a precedence over the others. The change in the indetation
was made to reflect that.

configure.ac

index f0894a0..024bbfb 100644 (file)
@@ -69,16 +69,21 @@ PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.2, dummy=yes,
 AC_SUBST(DBUS_CFLAGS)
 AC_SUBST(DBUS_LIBS)
 
-PKG_CHECK_MODULES(LIBNL2, libnl-2.0, [
-       NETLINK_CFLAGS=${LIBNL2_CFLAGS}
-       NETLINK_LIBS=${LIBNL2_LIBS}
+PKG_CHECK_MODULES(LIBNL3, libnl-3.0 libnl-genl-3.0, [
+       NETLINK_CFLAGS=${LIBNL3_CFLAGS}
+       NETLINK_LIBS=${LIBNL3_LIBS}
 ], [
-       PKG_CHECK_MODULES(LIBNL1, libnl-1, dummy=yes,
-                               AC_MSG_ERROR(Netlink library is required))
-       AC_DEFINE(NEED_LIBNL_COMPAT, 1,
+       PKG_CHECK_MODULES(LIBNL2, libnl-2.0, [
+               NETLINK_CFLAGS=${LIBNL2_CFLAGS}
+               NETLINK_LIBS=${LIBNL2_LIBS}
+       ], [
+               PKG_CHECK_MODULES(LIBNL1, libnl-1, dummy=yes,
+                       AC_MSG_ERROR(Netlink library is required))
+               AC_DEFINE(NEED_LIBNL_COMPAT, 1,
                        [Define to 1 if you need libnl-1 compat functions.])
-       NETLINK_CFLAGS=${LIBNL1_CFLAGS}
-       NETLINK_LIBS=${LIBNL1_LIBS}
+               NETLINK_CFLAGS=${LIBNL1_CFLAGS}
+               NETLINK_LIBS=${LIBNL1_LIBS}
+       ])
 ])
 AC_SUBST(NETLINK_CFLAGS)
 AC_SUBST(NETLINK_LIBS)