From d6fd1cf98a617aaf78ee98ec0a3ac5c468ac666f Mon Sep 17 00:00:00 2001 From: Alexandre Rostovtsev Date: Sun, 13 Nov 2011 17:51:47 -0500 Subject: [PATCH] Allow building against libnl:1.1 only Allow building against libnl:1.1 only for wimax. Otherwise, networkmanager will link to libnl-3.so and to libiWmxSdk (from wimax-1.5.2) which links to libnl.so, and then explode spectacularly at runtime due to symbol collisions. --- configure.ac | 47 +++++++++++++++++++---------------------------- 1 files changed, 19 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index ed66b3d..c88cbe4 100644 --- a/configure.ac +++ b/configure.ac @@ -379,32 +379,27 @@ AM_CONDITIONAL(SESSION_TRACKING_SYSTEMD, test "x$with_session_tracking" = "xsyst have_libnl="no" -PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [have_libnl3=yes], [have_libnl3=no]) -PKG_CHECK_MODULES(LIBNL_ROUTE3, libnl-route-3.0, [have_libnl_route3=yes], [have_libnl_route3=no]) -PKG_CHECK_MODULES(LIBNL_GENL3, libnl-genl-3.0, [have_libnl_genl3=yes], [have_libnl_genl3=no]) -if (test "${have_libnl3}" = "yes" -a "${have_libnl_route3}" = "yes" -a "${have_libnl_genl3}" = "yes"); then - AC_DEFINE(HAVE_LIBNL3, 1, [Define if you require specific libnl-3 support]) - LIBNL_CFLAGS="$LIBNL3_CFLAGS $LIBNL_ROUTE3_CFLAGS $LIBNL_GENL3_CFLAGS" - LIBNL_LIBS="$LIBNL3_LIBS $LIBNL_ROUTE3_LIBS $LIBNL_GENL3_LIBS" - libnl_version="3" - have_libnl="yes" +AC_ARG_WITH(libnl-1, AS_HELP_STRING([--with-libnl-1], [use legacy libnl-1 instead of libnl-3]), ,[with_libnl_1=no]) +if (test "${with_libnl_1}" = "yes"); then + 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" + NM_LIBNL_CHECK + fi 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" + PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [have_libnl3=yes], [have_libnl3=no]) + PKG_CHECK_MODULES(LIBNL_ROUTE3, libnl-route-3.0, [have_libnl_route3=yes], [have_libnl_route3=no]) + PKG_CHECK_MODULES(LIBNL_GENL3, libnl-genl-3.0, [have_libnl_genl3=yes], [have_libnl_genl3=no]) + if (test "${have_libnl3}" = "yes" -a "${have_libnl_route3}" = "yes" -a "${have_libnl_genl3}" = "yes"); then + AC_DEFINE(HAVE_LIBNL3, 1, [Define if you require specific libnl-3 support]) + LIBNL_CFLAGS="$LIBNL3_CFLAGS $LIBNL_ROUTE3_CFLAGS $LIBNL_GENL3_CFLAGS" + LIBNL_LIBS="$LIBNL3_LIBS $LIBNL_ROUTE3_LIBS $LIBNL_GENL3_LIBS" + libnl_version="3" 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 @@ -414,10 +409,6 @@ fi AC_SUBST(LIBNL_CFLAGS) AC_SUBST(LIBNL_LIBS) -if (test "${libnl_version}" = "1"); then - NM_LIBNL_CHECK -fi - PKG_CHECK_MODULES(UUID, uuid) AC_SUBST(UUID_CFLAGS) AC_SUBST(UUID_LIBS) -- 1.7.8.5