[PATCH] configure: Only check for older libnl versions if newer is unavailable



More recent libnl versions can be installed in parallel. Therefore it is
possible for more than one libnl check to pass successful. The way
the #ifdefs are done this results in code for multiple libnl versions
to be included.

Signed-off-by: Thomas Graf <tgraf redhat com>
---
 configure.ac |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index 117dd91..57e3aea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -314,24 +314,6 @@ fi
 AC_DEFINE_UNQUOTED(NO_CONSOLEKIT, $no_ck, [Define to disable use of ConsoleKit])
 
 have_libnl="no"
-PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0-pre8, [have_libnl1=yes], [have_libnl1=no])
-if (test "${have_libnl1}" = "yes"); then
-	AC_DEFINE(HAVE_LIBNL1, 1, [Define if you require libnl-1 legacy support])
-	LIBNL_CFLAGS="$LIBNL1_CFLAGS"
-	LIBNL_LIBS="$LIBNL1_LIBS"
-	libnl_version="1"
-	have_libnl="yes"
-fi
-
-PKG_CHECK_MODULES(LIBNL2, libnl-2.0, [have_libnl2=yes], [have_libnl2=no])
-if (test "${have_libnl2}" = "yes"); then
-	AC_DEFINE(HAVE_LIBNL2, 1, [Define if you require specific libnl-2 support])
-	LIBNL_CFLAGS="$LIBNL2_CFLAGS"
-	LIBNL_LIBS="$LIBNL2_LIBS"
-	libnl_version="2"
-	have_libnl="yes"
-fi
-
 PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [have_libnl2=yes], [have_libnl2=no])
 if (test "${have_libnl2}" = "yes"); then
 	AC_DEFINE(HAVE_LIBNL3, 1, [Define if you require specific libnl-3 support])
@@ -339,6 +321,24 @@ if (test "${have_libnl2}" = "yes"); then
 	LIBNL_LIBS="$LIBNL3_LIBS"
 	libnl_version="3"
 	have_libnl="yes"
+else
+	PKG_CHECK_MODULES(LIBNL2, libnl-2.0, [have_libnl2=yes], [have_libnl2=no])
+	if (test "${have_libnl2}" = "yes"); then
+		AC_DEFINE(HAVE_LIBNL2, 1, [Define if you require specific libnl-2 support])
+		LIBNL_CFLAGS="$LIBNL2_CFLAGS"
+		LIBNL_LIBS="$LIBNL2_LIBS"
+		libnl_version="2"
+		have_libnl="yes"
+	else
+		PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0-pre8, [have_libnl1=yes], [have_libnl1=no])
+		if (test "${have_libnl1}" = "yes"); then
+			AC_DEFINE(HAVE_LIBNL1, 1, [Define if you require libnl-1 legacy support])
+			LIBNL_CFLAGS="$LIBNL1_CFLAGS"
+			LIBNL_LIBS="$LIBNL1_LIBS"
+			libnl_version="1"
+			have_libnl="yes"
+		fi
+	fi
 fi
 
 if (test "${have_libnl}" = "no"); then
-- 
1.7.6



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]