Hi, Sergey,

Sorry for late reply.

I just tried it in my ubuntu11.04 x86-64 box, but it doesn't work.
for libnl2 and libnl3 cases, both failed in configure and with the same error like : No Package 'libnl-1' found.

So I didn't try it in other box anymore. 


2012/11/8 Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Hello,
can you please test this patch?


----

Rework libnl detection.

PKG_CHECK_MODULES macro appends FOO_CFLAGS and FOO_LIBS flags

Example:
LIBNL_CFLAGS = -I/usr/include/libnl3
LIBNL_LIBS = -lnl-genl-3 -lnl-3

while AC_SEARCH_LIBS only prepends -llibrary to LIBS, so AC_SEARCH_LIBS
is not helpful here.


Use pkg-config PC file names to search for minimum package versions:
libnl 3.+ -- libnl-3.0.pc
libnl 2.+ -- libnl-2.0.pc
libnl 1.+ -- libnl-1.0.pc


Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

---

 configure.ac | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index b8c183f..b9c3c2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,13 +54,10 @@ PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[


 has_libnl_ver=0
-PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0], [
-       has_libnl_ver=3], [
-       AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [
-               has_libnl_ver=3], [
-               AC_SEARCH_LIBS([nl_socket_alloc], [nl], [
-                       has_libnl_ver=2], [
-                       PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [])])])])
+
+PKG_CHECK_MODULES([LIBNL], [libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0], [has_libnl_ver=3], [
+       PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0 libnl-genl-2.0 >= 2.0], [has_libnl_ver=2], [
+               PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [])])])
 if (test "$has_libnl_ver" -eq 0); then
        AC_MSG_ERROR(libnl is required but not found)
 fi