simple patch to fix this issue (also as attachment):
commit 2150b9b784489f7a5b0b8d51a1de675504e6e1bd
Author: Austin Zhang <zhang.austin(a)gmail.com>
Date: Fri Nov 2 01:04:49 2012 +0800
Change library search condition for libnl2/3
So that we can compile in system with libnl2 or/and libnl3.
Signed-off-by: Austin Zhang <zhang.austin(a)gmail.com>
diff --git a/configure.ac b/configure.ac
index b8c183f..ccc0ec5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,11 +54,11 @@ PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[
has_libnl_ver=0
-PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0], [
+PKG_CHECK_MODULES([LIBNL], [libnl-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], [
+ PKG_CHECK_MODULES([LIBNL], [libnl-2.0], [
has_libnl_ver=2], [
PKG_CHECK_MODULES([LIBNL], [libnl-1],
[has_libnl_ver=1], [])])])])
if (test "$has_libnl_ver" -eq 0); then
2012/11/1 Austin Zhang <zhang.austin(a)gmail.com>
Patrick, thanks for your reply.
Yes, I already installed that dev pkg.
austin@austin-Studio:~/powertop/powertop-tset$ dpkg -L libnl3-dev | grep
pkgconfig
/usr/lib/pkgconfig
/usr/lib/pkgconfig/libnl-3.0.pc
austin@austin-Studio:~/powertop/powertop-tset$ cat
/usr/lib/pkgconfig/libnl-3.0.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: libnl
Description: Convenience library for netlink sockets
Version: 3.0
Libs: -L${libdir} -lnl -lnl-route -lnl-nf -lnl-genl -lnl-cli
Cflags: -I${includedir}
austin@austin-Studio:~/powertop/powertop-tset$
And I also tried to uninstall libnl3-dev, and re-install libnl2-dev, same
issue.
PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0], [ <=== when with
libnl-3.0.pc, the logic should fall into the following has_libnl_ver=3, but
seemed not;
has_libnl_ver=3], [
AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [ <=== I also
change the nl3 to nl, and remove nl-genl-3, but it cannot find
nl_socket_alloc, because this function is from bl2 and 3, so it seemed the
system doesn't try to find this function from /usr/lib/libnl.so at all,
has_libnl_ver=3], [
AC_SEARCH_LIBS([nl_socket_alloc], [nl], [ <===same case
like above
has_libnl_ver=2], [
PKG_CHECK_MODULES([LIBNL], [libnl-1],
[has_libnl_ver=1], [])])])]) <=== finally, fall into here, but because I
don't have libnl v1, so fail to work.
2012/11/1 Patrick McCarty <patrick.mccarty(a)linux.intel.com>
> On Wed, Oct 31, 2012 at 10:11:13PM +0800, Austin Zhang wrote:
> > Hi,
> >
> > I am trying to compile powertop on my box: ubuntu 12.04, X86-64.
> >
> > (1)compiling issue
> >
> > Here, my system didn’t install libnl-1, but I installed libnl2 (under
> /usr/lib)
> > and libnl-3 (under /lib).
> >
> > Then when ‘./configure’, I got:
> >
> > checking for LIBNL... no
> >
> > configure: error: Package requirements (libnl-1) were not met:
> >
> > No package 'libnl-1' found
> >
> > so seemed the below logic in configure.ac doesn’t work
> >
> > ……
> >
> > 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], [])])])])
> >
> > ……
>
> Based on the file lists you sent in a followup post, it appears that
> Ubuntu uses a different naming convention for these libraries, so
> AC_SEARCH_LIBS will not find the function it needs in either libnl-3 or
> libnl-genl-3, since they don't exist.
>
> Is there a -devel package you can install that provides a pkgconfig
> file for libnl-3?
>
> -Patrick
>