[Powertop] [PATCH] configure: First try to use libnl-3, then libnl-2, then libnl-1

Igor Zhbanov <i.zhbanov at samsung.com> Mon, 30 Jul 2012 17:55:11 +0400
Newsgroups dev.linux.lists.powertop
Message-ID <[email protected]>
Change search order for libnl in configure.ac:
first try to use libnl-3, then libnl-2, then libnl-1.
---
 configure.ac |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3f5775f..552626c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,12 +53,13 @@ PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[
  
 
 has_libnl_ver=0
-PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [
-	AC_SEARCH_LIBS([nl_socket_alloc], [nl], [has_libnl_ver=2], [
-		     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], [], [])])
-	], [])
-])
+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], [])])])])
 if (test "$has_libnl_ver" -eq 0); then
 	AC_MSG_ERROR(libnl is required but not found)
 fi
-- 
1.7.5.4