All of lore.kernel.org
 help / color / mirror / Atom feed
* [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-02 12:30 zhang.austin
  0 siblings, 0 replies; 23+ messages in thread
From: zhang.austin @ 2012-11-02 12:30 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1620 bytes --]

From: Austin Zhang <zhang.austin(a)gmail.com>

So that we can configure in system with libnl2 or/and libnl3.

Without/With this patch, the './configure' result as:
--------------------------------------------------------------------------------
                   |        ubuntu 11-10         ||          ubuntu 12.04
--------------------------------------------------------------------------------
                   | libnl-1 | libnl-2 | libnl-3 || libnl-1 | libnl-2 | libnl-3
--------------------------------------------------------------------------------
without this patch | Pass    | Fail    | Fail    || Pass    | Fail    | Pass
with    this patch | Pass    | Pass    | Pass    || Pass    | Pass    | Pass
--------------------------------------------------------------------------------

Signed-off-by: Austin Zhang <zhang.austin(a)gmail.com>
---
 configure.ac |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-02 14:32 Ferron, Chris E
  0 siblings, 0 replies; 23+ messages in thread
From: Ferron, Chris E @ 2012-11-02 14:32 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2254 bytes --]

Thanks for the testing data. As soon as I can verify or get
confirmation for this patch on Suse and Fedora at a minimum i will
merge.
That chunk of auto config has been a historical pain, so I want to
make sure it works on several distros.
-C


On Fri, Nov 2, 2012 at 5:30 AM,  <zhang.austin(a)gmail.com> wrote:
> From: Austin Zhang <zhang.austin(a)gmail.com>
>
> So that we can configure in system with libnl2 or/and libnl3.
>
> Without/With this patch, the './configure' result as:
> --------------------------------------------------------------------------------
>                    |        ubuntu 11-10         ||          ubuntu 12.04
> --------------------------------------------------------------------------------
>                    | libnl-1 | libnl-2 | libnl-3 || libnl-1 | libnl-2 | libnl-3
> --------------------------------------------------------------------------------
> without this patch | Pass    | Fail    | Fail    || Pass    | Fail    | Pass
> with    this patch | Pass    | Pass    | Pass    || Pass    | Pass    | Pass
> --------------------------------------------------------------------------------
>
> Signed-off-by: Austin Zhang <zhang.austin(a)gmail.com>
> ---
>  configure.ac |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> 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
> --
> 1.7.5.4
>
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-05 10:24 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-05 10:24 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]

Hello,
sorry for long reply

Can you please help testing this one?

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

 configure.ac | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index b8c183f..cf01279 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,13 +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], [
+AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [
 	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], [])])])])
+	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


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-05 10:51 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-05 10:51 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]


please ignore it. doesn't work.


	-ss

On (11/05/12 13:24), Sergey Senozhatsky wrote:
> Hello,
> sorry for long reply
> 
> Can you please help testing this one?
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
> 
> ---
> 
>  configure.ac | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index b8c183f..cf01279 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -54,13 +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], [
> +AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [
>  	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], [])])])])
> +	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
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-08 14:09 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-08 14:09 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

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(a)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


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 10:56 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-09 10:56 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2061 bytes --]

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(a)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(a)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
>
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2955 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 11:01 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-09 11:01 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

On (11/09/12 18:56), Austin Zhang wrote:
>    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.�
> 

Hello,

hm... can you please run

	pkg-config --list-all | grep -i nl

and send me output. thanks.


	-ss

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 11:17 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-09 11:17 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 762 bytes --]

libnl3:
libnl-3.0                      libnl - Convenience library for netlink
sockets

libnl2:
libnl-2.0                      libnl - Convenience library for netlink
sockets



2012/11/9 Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

> On (11/09/12 18:56), Austin Zhang wrote:
> >    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.�
> >
>
> Hello,
>
> hm... can you please run
>
>         pkg-config --list-all | grep -i nl
>
> and send me output. thanks.
>
>
>         -ss
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1270 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 11:30 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-09 11:30 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

On (11/09/12 19:17), Austin Zhang wrote:
>    libnl3:
>    libnl-3.0                      libnl - Convenience library for netlink
>    sockets
>    libnl2:
>    libnl-2.0                      libnl - Convenience library for netlink
>    sockets
> 

so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no evidence of, for example,
libnl-genl

pkg-config output on Arch

libnl-3.0                   libnl - Convenience library for netlink sockets
libnl-cli-3.0               libnl-cli - Command Line Interface library for netlink sockets
libnl-nf-3.0                libnl-nf - Netfilter Netlink Library
libnl-route-3.0             libnl-route - Netlink Routing Family Library
libnl-genl-3.0              libnl-genl - Generic Netlink Library


in case if we remove libnl-genl from PKG_CHECK_MODULES, we'll break the build, because LIBNL_LIBS
should be '-lnl-genl-3 -lnl-3', not just '-lnl-3'.

[..]
src/tuning/iw.c:89: undefined reference to `genl_connect'
src/tuning/iw.c:95: undefined reference to `genl_ctrl_alloc_cache'
src/tuning/iw.c:101: undefined reference to `genl_ctrl_search_by_name'
and so on...


looks like we need to workaround ubuntu.


	-ss

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 11:43 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-09 11:43 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

> but there are no evidence of,
nl-gen will only impact compile rather than configure, right?

Those above build time error will happen in upstream version if you only
install libnl3 but libnl-genl-3 for libnl3 case.

But anyway, it shouldn't impact 'configure' action.


2012/11/9 Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

> On (11/09/12 19:17), Austin Zhang wrote:
> >    libnl3:
> >    libnl-3.0                      libnl - Convenience library for netlink
> >    sockets
> >    libnl2:
> >    libnl-2.0                      libnl - Convenience library for netlink
> >    sockets
> >
>
> so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no evidence of,
> for example,
> libnl-genl
>
> pkg-config output on Arch
>
> libnl-3.0                   libnl - Convenience library for netlink sockets
> libnl-cli-3.0               libnl-cli - Command Line Interface library for
> netlink sockets
> libnl-nf-3.0                libnl-nf - Netfilter Netlink Library
> libnl-route-3.0             libnl-route - Netlink Routing Family Library
> libnl-genl-3.0              libnl-genl - Generic Netlink Library
>
>
> in case if we remove libnl-genl from PKG_CHECK_MODULES, we'll break the
> build, because LIBNL_LIBS
> should be '-lnl-genl-3 -lnl-3', not just '-lnl-3'.
>
> [..]
> src/tuning/iw.c:89: undefined reference to `genl_connect'
> src/tuning/iw.c:95: undefined reference to `genl_ctrl_alloc_cache'
> src/tuning/iw.c:101: undefined reference to `genl_ctrl_search_by_name'
> and so on...
>
>
> looks like we need to workaround ubuntu.
>
>
>         -ss
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2592 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 11:47 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-09 11:47 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2263 bytes --]

On (11/09/12 19:43), Austin Zhang wrote:
>    >�but there are no evidence of,
>    nl-gen will only impact compile rather than configure, right?
>    Those above build time error will happen in upstream version if you only
>    install libnl3 but libnl-genl-3 for libnl3 case.
>    But anyway, it shouldn't impact 'configure' action.�
>

disagree, successful configure itself is useless, build is the one that matters.
if one does not have all requirements for build, failed configure is ok.

	-ss

 
>    2012/11/9 Sergey Senozhatsky <[1]sergey.senozhatsky(a)gmail.com>
> 
>      On (11/09/12 19:17), Austin Zhang wrote:
>      > � �libnl3:
>      > � �libnl-3.0 � � � � � � � � � � �libnl - Convenience library for
>      netlink
>      > � �sockets
>      > � �libnl2:
>      > � �libnl-2.0 � � � � � � � � � � �libnl - Convenience library for
>      netlink
>      > � �sockets
>      >
> 
>      so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no evidence
>      of, for example,
>      libnl-genl
> 
>      pkg-config output on Arch
>      libnl-3.0 � � � � � � � � � libnl - Convenience library for netlink
>      sockets
>      libnl-cli-3.0 � � � � � � � libnl-cli - Command Line Interface library
>      for netlink sockets
>      libnl-nf-3.0 � � � � � � � �libnl-nf - Netfilter Netlink Library
>      libnl-route-3.0 � � � � � � libnl-route - Netlink Routing Family Library
>      libnl-genl-3.0 � � � � � � �libnl-genl - Generic Netlink Library
> 
>      in case if we remove libnl-genl from PKG_CHECK_MODULES, we'll break the
>      build, because LIBNL_LIBS
>      should be '-lnl-genl-3 -lnl-3', not just '-lnl-3'.
> 
>      [..]
>      src/tuning/iw.c:89: undefined reference to `genl_connect'
>      src/tuning/iw.c:95: undefined reference to `genl_ctrl_alloc_cache'
>      src/tuning/iw.c:101: undefined reference to `genl_ctrl_search_by_name'
>      and so on...
> 
>      looks like we need to workaround ubuntu.
> 
>      � � � � -ss
> 
> References
> 
>    Visible links
>    1. mailto:sergey.senozhatsky(a)gmail.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 12:07 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-09 12:07 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]


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

patch also changes $has_libnl_ver == 0 error message and suppresses
failed PKG_CHECK_MODULES output.


Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

 configure.ac | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index b8c183f..070b126 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,12 @@ 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.0], [has_libnl_ver=1], [has_libnl_ver=0])])])
 if (test "$has_libnl_ver" -eq 0); then
-	AC_MSG_ERROR(libnl is required but not found)
+	AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
 fi
 if (test "$has_libnl_ver" -gt 1); then
 	AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 12:18 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-09 12:18 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2897 bytes --]

> successful configure itself is useless, build is the one that matters.
Yes, I agree this, I just mean "not install genl is not the excuse of fail
to configure in _above_ cases".

After double check, in libnl-3 of ubuntu 11.10 (sorry, I wrote it as 11.04
in above email) includes these content of lib-genl, so in 11.10, no
libnl-genl, which only is in 12.04, where the nl version is: 3.2.3.

and for libnl2, also no genl.


2012/11/9 Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

> On (11/09/12 19:43), Austin Zhang wrote:
> >    >�but there are no evidence of,
> >    nl-gen will only impact compile rather than configure, right?
> >    Those above build time error will happen in upstream version if you
> only
> >    install libnl3 but libnl-genl-3 for libnl3 case.
> >    But anyway, it shouldn't impact 'configure' action.�
> >
>
> disagree, successful configure itself is useless, build is the one that
> matters.
> if one does not have all requirements for build, failed configure is ok.
>
>         -ss
>
>
> >    2012/11/9 Sergey Senozhatsky <[1]sergey.senozhatsky(a)gmail.com>
> >
> >      On (11/09/12 19:17), Austin Zhang wrote:
> >      > � �libnl3:
> >      > � �libnl-3.0 � � � � � � � � � � �libnl - Convenience library for
> >      netlink
> >      > � �sockets
> >      > � �libnl2:
> >      > � �libnl-2.0 � � � � � � � � � � �libnl - Convenience library for
> >      netlink
> >      > � �sockets
> >      >
> >
> >      so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no
> evidence
> >      of, for example,
> >      libnl-genl
> >
> >      pkg-config output on Arch
> >      libnl-3.0 � � � � � � � � � libnl - Convenience library for netlink
> >      sockets
> >      libnl-cli-3.0 � � � � � � � libnl-cli - Command Line Interface
> library
> >      for netlink sockets
> >      libnl-nf-3.0 � � � � � � � �libnl-nf - Netfilter Netlink Library
> >      libnl-route-3.0 � � � � � � libnl-route - Netlink Routing Family
> Library
> >      libnl-genl-3.0 � � � � � � �libnl-genl - Generic Netlink Library
> >
> >      in case if we remove libnl-genl from PKG_CHECK_MODULES, we'll break
> the
> >      build, because LIBNL_LIBS
> >      should be '-lnl-genl-3 -lnl-3', not just '-lnl-3'.
> >
> >      [..]
> >      src/tuning/iw.c:89: undefined reference to `genl_connect'
> >      src/tuning/iw.c:95: undefined reference to `genl_ctrl_alloc_cache'
> >      src/tuning/iw.c:101: undefined reference to
> `genl_ctrl_search_by_name'
> >      and so on...
> >
> >      looks like we need to workaround ubuntu.
> >
> >      � � � � -ss
> >
> > References
> >
> >    Visible links
> >    1. mailto:sergey.senozhatsky(a)gmail.com
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3834 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 13:01 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-09 13:01 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 4207 bytes --]

On (11/09/12 20:18), Austin Zhang wrote:
>    > successful configure itself is useless, build is the one that matters.
>    Yes, I agree this, I just mean "not install genl is not the excuse of fail
>    to configure in _above_ cases". 

sorry, not sure. 
missing dependency is a very good reason to fail configure. in fact, configure is performed
to validate system if it fits minimum build requirements. and in our case missing libnl
and libnl-genl are a show stoppers.

but yes, we have a problem with that ubuntu package mess that we have to address.


>    After double check, in libnl-3 of ubuntu 11.10 (sorry, I wrote it as 11.04
>    in above email) includes these content of lib-genl, so in 11.10, no
>    libnl-genl, which only is in 12.04, where the nl version is: 3.2.3.
>    and for libnl2, also no genl.
>

is this correct?

ubuntu	libnl-3.*.so	libnl-genl-3.*.so	libnl-2.*.so	libnl-genl-2.*.so
11.10	+		-			+		-
12.04	+		+			+		+


is 11.10 still supported? if support for that version is discontinued then I'm not sure
we really must care.


	-ss

 
>    2012/11/9 Sergey Senozhatsky <[1]sergey.senozhatsky(a)gmail.com>
> 
>      On (11/09/12 19:43), Austin Zhang wrote:
>      >    >�but there are no evidence of,
>      >    nl-gen will only impact compile rather than configure, right?
>      >    Those above build time error will happen in upstream version if you
>      only
>      >    install libnl3 but libnl-genl-3 for libnl3 case.
>      >    But anyway, it shouldn't impact 'configure' action.�
>      >
> 
>      disagree, successful configure itself is useless, build is the one that
>      matters.
>      if one does not have all requirements for build, failed configure is ok.
> 
>              -ss
> 
>      >    2012/11/9 Sergey Senozhatsky <[1][2]sergey.senozhatsky(a)gmail.com>
>      >
>      >      On (11/09/12 19:17), Austin Zhang wrote:
>      >      > � �libnl3:
>      >      > � �libnl-3.0 � � � � � � � � � � �libnl - Convenience library
>      for
>      >      netlink
>      >      > � �sockets
>      >      > � �libnl2:
>      >      > � �libnl-2.0 � � � � � � � � � � �libnl - Convenience library
>      for
>      >      netlink
>      >      > � �sockets
>      >      >
>      >
>      >      so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no
>      evidence
>      >      of, for example,
>      >      libnl-genl
>      >
>      >      pkg-config output on Arch
>      >      libnl-3.0 � � � � � � � � � libnl - Convenience library for
>      netlink
>      >      sockets
>      >      libnl-cli-3.0 � � � � � � � libnl-cli - Command Line Interface
>      library
>      >      for netlink sockets
>      >      libnl-nf-3.0 � � � � � � � �libnl-nf - Netfilter Netlink Library
>      >      libnl-route-3.0 � � � � � � libnl-route - Netlink Routing Family
>      Library
>      >      libnl-genl-3.0 � � � � � � �libnl-genl - Generic Netlink Library
>      >
>      >      in case if we remove libnl-genl from PKG_CHECK_MODULES, we'll
>      break the
>      >      build, because LIBNL_LIBS
>      >      should be '-lnl-genl-3 -lnl-3', not just '-lnl-3'.
>      >
>      >      [..]
>      >      src/tuning/iw.c:89: undefined reference to `genl_connect'
>      >      src/tuning/iw.c:95: undefined reference to
>      `genl_ctrl_alloc_cache'
>      >      src/tuning/iw.c:101: undefined reference to
>      `genl_ctrl_search_by_name'
>      >      and so on...
>      >
>      >      looks like we need to workaround ubuntu.
>      >
>      >      � � � � -ss
>      >
>      > References
>      >
>      >    Visible links
>      >    1. mailto:[3]sergey.senozhatsky(a)gmail.com
> 
> References
> 
>    Visible links
>    1. mailto:sergey.senozhatsky(a)gmail.com
>    2. mailto:sergey.senozhatsky(a)gmail.com
>    3. mailto:sergey.senozhatsky(a)gmail.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 15:19 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-09 15:19 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 5941 bytes --]

> is this correct?
I listed it here for your reference.
12.04
# dpkg -L libnl1 | grep so
/usr/lib/i386-linux-gnu/libnl.so.1.1
/usr/lib/i386-linux-gnu/libnl.so.1
# dpkg -L libnl2 | grep so

/usr/lib/libnl-cli.so.2.0.0
/usr/lib/libnl-genl.so.2.0.0
/usr/lib/libnl-nf.so.2.0.0
/usr/lib/libnl-route.so.2.0.0
/usr/lib/libnl.so.2.0.0
/usr/lib/libnl-cli.so.2
/usr/lib/libnl-genl.so.2
/usr/lib/libnl-nf.so.2
/usr/lib/libnl-route.so.2
/usr/lib/libnl.so.2
# dpkg -L libnl-3-200 | grep so

/lib/libnl-3.so.200.3.0
/lib/libnl-3.so.200
# dpkg -L libnl-genl-3-200 | grep so
/lib/libnl-genl-3.so.200.3.0
/lib/libnl-genl-3.so.200


11.10
$ dpkg -L libnl1 | grep so
/usr/lib/libnl.so.1.1
/usr/lib/libnl.so.1
$ dpkg -L libnl2 | grep so

/usr/lib/libnl-cli.so.2.0.0
/usr/lib/libnl-route.so.2.0.0
/usr/lib/libnl-genl.so.2.0.0
/usr/lib/libnl-nf.so.2.0.0
/usr/lib/libnl.so.2.0.0
/usr/lib/libnl-route.so.2
/usr/lib/libnl-cli.so.2
/usr/lib/libnl-genl.so.2
/usr/lib/libnl.so.2
/usr/lib/libnl-nf.so.2
$ dpkg -L libnl3 | grep so

/usr/lib/libnl-cli.so.3.0.0
/usr/lib/libnl-genl.so.3.0.0
/usr/lib/libnl-nf.so.3.0.0
/usr/lib/libnl-route.so.3.0.0
/usr/lib/libnl.so.3.0.0
/usr/lib/libnl-cli.so.3
/usr/lib/libnl-genl.so.3
/usr/lib/libnl-nf.so.3
/usr/lib/libnl-route.so.3
/usr/lib/libnl.so.3


> is 11.10 still supported?
I thought it should, but it is up to you all maintainers:-)



2012/11/9 Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

> On (11/09/12 20:18), Austin Zhang wrote:
> >    > successful configure itself is useless, build is the one that
> matters.
> >    Yes, I agree this, I just mean "not install genl is not the excuse of
> fail
> >    to configure in _above_ cases".
>
> sorry, not sure.
> missing dependency is a very good reason to fail configure. in fact,
> configure is performed
> to validate system if it fits minimum build requirements. and in our case
> missing libnl
> and libnl-genl are a show stoppers.
>
> but yes, we have a problem with that ubuntu package mess that we have to
> address.
>
>
> >    After double check, in libnl-3 of ubuntu 11.10 (sorry, I wrote it as
> 11.04
> >    in above email) includes these content of lib-genl, so in 11.10, no
> >    libnl-genl, which only is in 12.04, where the nl version is: 3.2.3.
> >    and for libnl2, also no genl.
> >
>
> is this correct?
>
> ubuntu  libnl-3.*.so    libnl-genl-3.*.so       libnl-2.*.so
>  libnl-genl-2.*.so
> 11.10   +               -                       +               -
> 12.04   +               +                       +               +
>
>
> is 11.10 still supported? if support for that version is discontinued then
> I'm not sure
> we really must care.
>
>
>         -ss
>
>
> >    2012/11/9 Sergey Senozhatsky <[1]sergey.senozhatsky(a)gmail.com>
> >
> >      On (11/09/12 19:43), Austin Zhang wrote:
> >      >    >�but there are no evidence of,
> >      >    nl-gen will only impact compile rather than configure, right?
> >      >    Those above build time error will happen in upstream version
> if you
> >      only
> >      >    install libnl3 but libnl-genl-3 for libnl3 case.
> >      >    But anyway, it shouldn't impact 'configure' action.�
> >      >
> >
> >      disagree, successful configure itself is useless, build is the one
> that
> >      matters.
> >      if one does not have all requirements for build, failed configure
> is ok.
> >
> >              -ss
> >
> >      >    2012/11/9 Sergey Senozhatsky <[1][2]
> sergey.senozhatsky(a)gmail.com>
> >      >
> >      >      On (11/09/12 19:17), Austin Zhang wrote:
> >      >      > � �libnl3:
> >      >      > � �libnl-3.0 � � � � � � � � � � �libnl - Convenience
> library
> >      for
> >      >      netlink
> >      >      > � �sockets
> >      >      > � �libnl2:
> >      >      > � �libnl-2.0 � � � � � � � � � � �libnl - Convenience
> library
> >      for
> >      >      netlink
> >      >      > � �sockets
> >      >      >
> >      >
> >      >      so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no
> >      evidence
> >      >      of, for example,
> >      >      libnl-genl
> >      >
> >      >      pkg-config output on Arch
> >      >      libnl-3.0 � � � � � � � � � libnl - Convenience library for
> >      netlink
> >      >      sockets
> >      >      libnl-cli-3.0 � � � � � � � libnl-cli - Command Line
> Interface
> >      library
> >      >      for netlink sockets
> >      >      libnl-nf-3.0 � � � � � � � �libnl-nf - Netfilter Netlink
> Library
> >      >      libnl-route-3.0 � � � � � � libnl-route - Netlink Routing
> Family
> >      Library
> >      >      libnl-genl-3.0 � � � � � � �libnl-genl - Generic Netlink
> Library
> >      >
> >      >      in case if we remove libnl-genl from PKG_CHECK_MODULES, we'll
> >      break the
> >      >      build, because LIBNL_LIBS
> >      >      should be '-lnl-genl-3 -lnl-3', not just '-lnl-3'.
> >      >
> >      >      [..]
> >      >      src/tuning/iw.c:89: undefined reference to `genl_connect'
> >      >      src/tuning/iw.c:95: undefined reference to
> >      `genl_ctrl_alloc_cache'
> >      >      src/tuning/iw.c:101: undefined reference to
> >      `genl_ctrl_search_by_name'
> >      >      and so on...
> >      >
> >      >      looks like we need to workaround ubuntu.
> >      >
> >      >      � � � � -ss
> >      >
> >      > References
> >      >
> >      >    Visible links
> >      >    1. mailto:[3]sergey.senozhatsky(a)gmail.com
> >
> > References
> >
> >    Visible links
> >    1. mailto:sergey.senozhatsky(a)gmail.com
> >    2. mailto:sergey.senozhatsky(a)gmail.com
> >    3. mailto:sergey.senozhatsky(a)gmail.com
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 9086 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-09 15:25 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-09 15:25 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 8298 bytes --]

On (11/09/12 23:19), Austin Zhang wrote:
>    > is this correct?
>    I listed it here for your reference.

 thanks a lot!
 I'll take a look.

	-ss

>    12.04
>    # dpkg -L libnl1 | grep so
>    /usr/lib/i386-linux-gnu/libnl.so.1.1
>    /usr/lib/i386-linux-gnu/libnl.so.1
>    # dpkg -L libnl2 | grep so                                                
>                                                             
>    /usr/lib/libnl-cli.so.2.0.0
>    /usr/lib/libnl-genl.so.2.0.0
>    /usr/lib/libnl-nf.so.2.0.0
>    /usr/lib/libnl-route.so.2.0.0
>    /usr/lib/libnl.so.2.0.0
>    /usr/lib/libnl-cli.so.2
>    /usr/lib/libnl-genl.so.2
>    /usr/lib/libnl-nf.so.2
>    /usr/lib/libnl-route.so.2
>    /usr/lib/libnl.so.2
>    # dpkg -L libnl-3-200 | grep so                                          
>                                                              
>    /lib/libnl-3.so.200.3.0
>    /lib/libnl-3.so.200
>    # dpkg -L libnl-genl-3-200 | grep so
>    /lib/libnl-genl-3.so.200.3.0
>    /lib/libnl-genl-3.so.200
>    11.10
>    $ dpkg -L libnl1 | grep so
>    /usr/lib/libnl.so.1.1
>    /usr/lib/libnl.so.1
>    $ dpkg -L libnl2 | grep so                                                
>                                                 
>    /usr/lib/libnl-cli.so.2.0.0
>    /usr/lib/libnl-route.so.2.0.0
>    /usr/lib/libnl-genl.so.2.0.0
>    /usr/lib/libnl-nf.so.2.0.0
>    /usr/lib/libnl.so.2.0.0
>    /usr/lib/libnl-route.so.2
>    /usr/lib/libnl-cli.so.2
>    /usr/lib/libnl-genl.so.2
>    /usr/lib/libnl.so.2
>    /usr/lib/libnl-nf.so.2
>    $ dpkg -L libnl3 | grep so                                                
>                                                 
>    /usr/lib/libnl-cli.so.3.0.0
>    /usr/lib/libnl-genl.so.3.0.0
>    /usr/lib/libnl-nf.so.3.0.0
>    /usr/lib/libnl-route.so.3.0.0
>    /usr/lib/libnl.so.3.0.0
>    /usr/lib/libnl-cli.so.3
>    /usr/lib/libnl-genl.so.3
>    /usr/lib/libnl-nf.so.3
>    /usr/lib/libnl-route.so.3
>    /usr/lib/libnl.so.3
>    > is 11.10 still supported?
>    I thought it should, but it is up to you all maintainers:-)
>     
> 
>    2012/11/9 Sergey Senozhatsky <[1]sergey.senozhatsky(a)gmail.com>
> 
>      On (11/09/12 20:18), Austin Zhang wrote:
>      >    > successful configure itself is useless, build is the one that
>      matters.
>      >    Yes, I agree this, I just mean "not install genl is not the excuse
>      of fail
>      >    to configure in _above_ cases". 
> 
>      sorry, not sure.
>      missing dependency is a very good reason to fail configure. in fact,
>      configure is performed
>      to validate system if it fits minimum build requirements. and in our
>      case missing libnl
>      and libnl-genl are a show stoppers.
> 
>      but yes, we have a problem with that ubuntu package mess that we have to
>      address.
> 
>      >    After double check, in libnl-3 of ubuntu 11.10 (sorry, I wrote it
>      as 11.04
>      >    in above email) includes these content of lib-genl, so in 11.10, no
>      >    libnl-genl, which only is in 12.04, where the nl version is: 3.2.3.
>      >    and for libnl2, also no genl.
>      >
> 
>      is this correct?
> 
>      ubuntu  libnl-3.*.so    libnl-genl-3.*.so       libnl-2.*.so  
>       libnl-genl-2.*.so
>      11.10   +               -                       +               -
>      12.04   +               +                       +               +
> 
>      is 11.10 still supported? if support for that version is discontinued
>      then I'm not sure
>      we really must care.
> 
>              -ss
> 
>      >    2012/11/9 Sergey Senozhatsky <[1][2]sergey.senozhatsky(a)gmail.com>
>      >
>      >      On (11/09/12 19:43), Austin Zhang wrote:
>      >      >    >�but there are no evidence of,
>      >      >    nl-gen will only impact compile rather than configure,
>      right?
>      >      >    Those above build time error will happen in upstream version
>      if you
>      >      only
>      >      >    install libnl3 but libnl-genl-3 for libnl3 case.
>      >      >    But anyway, it shouldn't impact 'configure' action.�
>      >      >
>      >
>      >      disagree, successful configure itself is useless, build is the
>      one that
>      >      matters.
>      >      if one does not have all requirements for build, failed configure
>      is ok.
>      >
>      >              -ss
>      >
>      >      >    2012/11/9 Sergey Senozhatsky
>      <[1][2][3]sergey.senozhatsky(a)gmail.com>
>      >      >
>      >      >      On (11/09/12 19:17), Austin Zhang wrote:
>      >      >      > � �libnl3:
>      >      >      > � �libnl-3.0 � � � � � � � � � � �libnl - Convenience
>      library
>      >      for
>      >      >      netlink
>      >      >      > � �sockets
>      >      >      > � �libnl2:
>      >      >      > � �libnl-2.0 � � � � � � � � � � �libnl - Convenience
>      library
>      >      for
>      >      >      netlink
>      >      >      > � �sockets
>      >      >      >
>      >      >
>      >      >      so, libnl-3.0.pc and libnl-2.0.pc are there, but there are
>      no
>      >      evidence
>      >      >      of, for example,
>      >      >      libnl-genl
>      >      >
>      >      >      pkg-config output on Arch
>      >      >      libnl-3.0 � � � � � � � � � libnl - Convenience library
>      for
>      >      netlink
>      >      >      sockets
>      >      >      libnl-cli-3.0 � � � � � � � libnl-cli - Command Line
>      Interface
>      >      library
>      >      >      for netlink sockets
>      >      >      libnl-nf-3.0 � � � � � � � �libnl-nf - Netfilter Netlink
>      Library
>      >      >      libnl-route-3.0 � � � � � � libnl-route - Netlink Routing
>      Family
>      >      Library
>      >      >      libnl-genl-3.0 � � � � � � �libnl-genl - Generic Netlink
>      Library
>      >      >
>      >      >      in case if we remove libnl-genl from PKG_CHECK_MODULES,
>      we'll
>      >      break the
>      >      >      build, because LIBNL_LIBS
>      >      >      should be '-lnl-genl-3 -lnl-3', not just '-lnl-3'.
>      >      >
>      >      >      [..]
>      >      >      src/tuning/iw.c:89: undefined reference to `genl_connect'
>      >      >      src/tuning/iw.c:95: undefined reference to
>      >      `genl_ctrl_alloc_cache'
>      >      >      src/tuning/iw.c:101: undefined reference to
>      >      `genl_ctrl_search_by_name'
>      >      >      and so on...
>      >      >
>      >      >      looks like we need to workaround ubuntu.
>      >      >
>      >      >      � � � � -ss
>      >      >
>      >      > References
>      >      >
>      >      >    Visible links
>      >      >    1. mailto:[3][4]sergey.senozhatsky(a)gmail.com
>      >
>      > References
>      >
>      >    Visible links
>      >    1. mailto:[5]sergey.senozhatsky(a)gmail.com
>      >    2. mailto:[6]sergey.senozhatsky(a)gmail.com
>      >    3. mailto:[7]sergey.senozhatsky(a)gmail.com
> 
> References
> 
>    Visible links
>    1. mailto:sergey.senozhatsky(a)gmail.com
>    2. mailto:sergey.senozhatsky(a)gmail.com
>    3. mailto:sergey.senozhatsky(a)gmail.com
>    4. mailto:sergey.senozhatsky(a)gmail.com
>    5. mailto:sergey.senozhatsky(a)gmail.com
>    6. mailto:sergey.senozhatsky(a)gmail.com
>    7. mailto:sergey.senozhatsky(a)gmail.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-12  9:09 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-12  9:09 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]

Hello,
may I ask you ti test the following one?


Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

 configure.ac | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index b8c183f..cee5bf3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,20 @@ 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], [has_libnl_ver=3], [
+	PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2], [
+		PKG_CHECK_MODULES([LIBNL], [libnl-1.0], [has_libnl_ver=1], [has_libnl_ver=0])])])
+
+#Austin Zhang reported failed configure on Ubuntu. It tourned out that ubuntu does
+#not provide genl pkg-config files, thus PKG_CHECK_MODULES fails to check for
+#libnl-genl.
+#NOTE: AC_SEARCH_LIBS append -lnl-genl to LIBS, not to LIBNL_LIBS.
+#
+AC_SEARCH_LIBS([genl_connect], [nl-genl], [], [has_libnl_ver=0])
+
 if (test "$has_libnl_ver" -eq 0); then
-	AC_MSG_ERROR(libnl is required but not found)
+	AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
 fi
 if (test "$has_libnl_ver" -gt 1); then
 	AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-13  9:06 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-13  9:06 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 3010 bytes --]

Unfortunately, it only works in one 11.10 case, and doesn't work for
others. For libnl-3 case,
...
checking for library containing genl_connect...no
...

I checked the libnl-genl-3.so was install under /lib/i386-linux-gnu/
(12.10) or /lib/libnl-genl-3.0 (12.04) and I am sure it included
genl_connect, but now seemed AC_SEARCH_LIBS cannot find it at all.

But with some changes on above 1108 patch like:
from
+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],
[])])])

to
+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], [has_libnl_ver=2], [
+               PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1],
[])])])

Don't check  libnl-genl-2.0 >= 2.0 ( as patch in 1108) and don't use
AC_SEARCH_LIBS
(as patch in above last one) at all.
Now, it works in 11.10/12.04/12.10 for all libnl-3/libnl2/libnl.


2012/11/12 Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

> Hello,
> may I ask you ti test the following one?
>
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
>
> ---
>
>  configure.ac | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index b8c183f..cee5bf3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -54,15 +54,20 @@ 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], [has_libnl_ver=3], [
> +       PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2], [
> +               PKG_CHECK_MODULES([LIBNL], [libnl-1.0], [has_libnl_ver=1],
> [has_libnl_ver=0])])])
> +
> +#Austin Zhang reported failed configure on Ubuntu. It tourned out that
> ubuntu does
> +#not provide genl pkg-config files, thus PKG_CHECK_MODULES fails to check
> for
> +#libnl-genl.
> +#NOTE: AC_SEARCH_LIBS append -lnl-genl to LIBS, not to LIBNL_LIBS.
> +#
> +AC_SEARCH_LIBS([genl_connect], [nl-genl], [], [has_libnl_ver=0])
> +
>  if (test "$has_libnl_ver" -eq 0); then
> -       AC_MSG_ERROR(libnl is required but not found)
> +       AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
>  fi
>  if (test "$has_libnl_ver" -gt 1); then
>         AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or
> higher])
>
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 4795 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-13  9:26 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-13  9:26 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]

On (11/13/12 17:06), Austin Zhang wrote:
> 
>    Unfortunately, it only works in one 11.10 case, and doesn't work for
>    others. For libnl-3 case,
>    ...
>    checking for library containing genl_connect...no
>    ...
>
ok, which means that genl_connect is withing libnl.

I really would like to keep checks consistent, otherwise it's a bit unclear
why we check 'libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0' and only 'libnl-2.0',
besides, I've a feeling that will break build on some distros (in case if 
that is only Ubuntu specific, we'll end up w/o -nl-genl).

Add -nl to AC_SEARCH_LIBS.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

 configure.ac | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index b8c183f..0958d73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,20 @@ 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], [has_libnl_ver=3], [
+	PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2], [
+		PKG_CHECK_MODULES([LIBNL], [libnl-1.0], [has_libnl_ver=1], [has_libnl_ver=0])])])
+
+#Austin Zhang reported failed configure on Ubuntu. It turned out that ubuntu does
+#not provide genl pkg-config files, thus PKG_CHECK_MODULES fails to check for
+#libnl-genl.
+#NOTE: AC_SEARCH_LIBS append -lnl-genl to LIBS, not to LIBNL_LIBS.
+#
+AC_SEARCH_LIBS([genl_connect], [nl-genl nl], [], [has_libnl_ver=0])
+
 if (test "$has_libnl_ver" -eq 0); then
-	AC_MSG_ERROR(libnl is required but not found)
+	AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
 fi
 if (test "$has_libnl_ver" -gt 1); then
 	AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-13  9:47 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-13  9:47 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2948 bytes --]

> why we check 'libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0' and only
'libnl-2.0',
Because for v2, it just have separated libnl-genl library, but there were
no separated pkg named libnl-genl-2.0.

>+AC_SEARCH_LIBS([genl_connect], [nl-genl nl], [], [has_libnl_ver=0])
With additional 'nl' checking, It doesn't help. Failed with same error
under both v3 and v2 cases for 12.04 (doesn't try others).
If fact, genl_connect is in nl-genl both for v2 and v3. Not sure if it is
some search path issue.


2012/11/13 Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

> On (11/13/12 17:06), Austin Zhang wrote:
> >
> >    Unfortunately, it only works in one 11.10 case, and doesn't work for
> >    others. For libnl-3 case,
> >    ...
> >    checking for library containing genl_connect...no
> >    ...
> >
> ok, which means that genl_connect is withing libnl.
>
> I really would like to keep checks consistent, otherwise it's a bit unclear
> why we check 'libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0' and only 'libnl-2.0',
> besides, I've a feeling that will break build on some distros (in case if
> that is only Ubuntu specific, we'll end up w/o -nl-genl).
>
> Add -nl to AC_SEARCH_LIBS.
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
>
> ---
>
>  configure.ac | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index b8c183f..0958d73 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -54,15 +54,20 @@ 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], [has_libnl_ver=3], [
> +       PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2], [
> +               PKG_CHECK_MODULES([LIBNL], [libnl-1.0], [has_libnl_ver=1],
> [has_libnl_ver=0])])])
> +
> +#Austin Zhang reported failed configure on Ubuntu. It turned out that
> ubuntu does
> +#not provide genl pkg-config files, thus PKG_CHECK_MODULES fails to check
> for
> +#libnl-genl.
> +#NOTE: AC_SEARCH_LIBS append -lnl-genl to LIBS, not to LIBNL_LIBS.
> +#
> +AC_SEARCH_LIBS([genl_connect], [nl-genl nl], [], [has_libnl_ver=0])
> +
>  if (test "$has_libnl_ver" -eq 0); then
> -       AC_MSG_ERROR(libnl is required but not found)
> +       AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
>  fi
>  if (test "$has_libnl_ver" -gt 1); then
>         AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or
> higher])
>
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 4535 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-13  9:49 Austin Zhang
  0 siblings, 0 replies; 23+ messages in thread
From: Austin Zhang @ 2012-11-13  9:49 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 3295 bytes --]

a little correction:
-Failed with same error under both v3 and v2 cases for 12.04 (doesn't try
others).
+Failed with same error under v3 cases for 12.04 (doesn't try others).


2012/11/13 Austin Zhang <zhang.austin(a)gmail.com>

> > why we check 'libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0' and only
> 'libnl-2.0',
> Because for v2, it just have separated libnl-genl library, but there were
> no separated pkg named libnl-genl-2.0.
>
>
> >+AC_SEARCH_LIBS([genl_connect], [nl-genl nl], [], [has_libnl_ver=0])
> With additional 'nl' checking, It doesn't help. Failed with same error
> under both v3 and v2 cases for 12.04 (doesn't try others).
> If fact, genl_connect is in nl-genl both for v2 and v3. Not sure if it is
> some search path issue.
>
>
> 2012/11/13 Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
>
>> On (11/13/12 17:06), Austin Zhang wrote:
>> >
>> >    Unfortunately, it only works in one 11.10 case, and doesn't work for
>> >    others. For libnl-3 case,
>> >    ...
>> >    checking for library containing genl_connect...no
>> >    ...
>> >
>> ok, which means that genl_connect is withing libnl.
>>
>> I really would like to keep checks consistent, otherwise it's a bit
>> unclear
>> why we check 'libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0' and only
>> 'libnl-2.0',
>> besides, I've a feeling that will break build on some distros (in case if
>> that is only Ubuntu specific, we'll end up w/o -nl-genl).
>>
>> Add -nl to AC_SEARCH_LIBS.
>>
>> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
>>
>> ---
>>
>>  configure.ac | 21 +++++++++++++--------
>>  1 file changed, 13 insertions(+), 8 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index b8c183f..0958d73 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -54,15 +54,20 @@ 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], [has_libnl_ver=3], [
>> +       PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2],
>> [
>> +               PKG_CHECK_MODULES([LIBNL], [libnl-1.0],
>> [has_libnl_ver=1], [has_libnl_ver=0])])])
>> +
>> +#Austin Zhang reported failed configure on Ubuntu. It turned out that
>> ubuntu does
>> +#not provide genl pkg-config files, thus PKG_CHECK_MODULES fails to
>> check for
>> +#libnl-genl.
>> +#NOTE: AC_SEARCH_LIBS append -lnl-genl to LIBS, not to LIBNL_LIBS.
>> +#
>> +AC_SEARCH_LIBS([genl_connect], [nl-genl nl], [], [has_libnl_ver=0])
>> +
>>  if (test "$has_libnl_ver" -eq 0); then
>> -       AC_MSG_ERROR(libnl is required but not found)
>> +       AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
>>  fi
>>  if (test "$has_libnl_ver" -gt 1); then
>>         AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or
>> higher])
>>
>>
>

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 5300 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-13 10:18 Sergey Senozhatsky
  0 siblings, 0 replies; 23+ messages in thread
From: Sergey Senozhatsky @ 2012-11-13 10:18 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2117 bytes --]

On (11/13/12 17:47), Austin Zhang wrote:
> 
>    > why we check 'libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0' and only
>    'libnl-2.0',
>    Because for v2, it just have�separated�libnl-genl library, but there were
>    no�separated pkg named�libnl-genl-2.0.
>    >+AC_SEARCH_LIBS([genl_connect], [nl-genl nl], [], [has_libnl_ver=0])
>    With additional 'nl' checking, It doesn't help. Failed with same error
>    under both v3 and v2 cases for 12.04 (doesn't try others).�
>    If fact, genl_connect is in nl-genl both for v2 and v3. Not sure if it is
>    some search path issue.�
> 

hm. ok, thanks for info. I'll check libnl 2.0 repo if they ever had pkg-config file
other than libnl-2.0.pc. If the only one they provide is libnl-2.0.pc then we'll stick
with inital PKG_CHECK_MODULES rework and your adjustment to libnl-2.0 case.

thanks for your patience and help!


Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>

---

 configure.ac | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index b8c183f..e6ae3ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +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], [
-	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], [has_libnl_ver=2], [
+		PKG_CHECK_MODULES([LIBNL], [libnl-1.0], [has_libnl_ver=1], [has_libnl_ver=0])])])
 if (test "$has_libnl_ver" -eq 0); then
-	AC_MSG_ERROR(libnl is required but not found)
+	AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
 fi
 if (test "$has_libnl_ver" -gt 1); then
 	AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
@ 2012-11-13 15:30 Namhyung Kim
  0 siblings, 0 replies; 23+ messages in thread
From: Namhyung Kim @ 2012-11-13 15:30 UTC (permalink / raw)
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]

2012-11-13 (화), 13:18 +0300, Sergey Senozhatsky:
> On (11/13/12 17:47), Austin Zhang wrote:
> > 
> >    > why we check 'libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0' and only
> >    'libnl-2.0',
> >    Because for v2, it just have�separated�libnl-genl library, but there were
> >    no�separated pkg named�libnl-genl-2.0.
> >    >+AC_SEARCH_LIBS([genl_connect], [nl-genl nl], [], [has_libnl_ver=0])
> >    With additional 'nl' checking, It doesn't help. Failed with same error
> >    under both v3 and v2 cases for 12.04 (doesn't try others).�
> >    If fact, genl_connect is in nl-genl both for v2 and v3. Not sure if it is
> >    some search path issue.�
> > 
> 
> hm. ok, thanks for info. I'll check libnl 2.0 repo if they ever had pkg-config file
> other than libnl-2.0.pc. If the only one they provide is libnl-2.0.pc then we'll stick
> with inital PKG_CHECK_MODULES rework and your adjustment to libnl-2.0 case.
> 
> thanks for your patience and help!
> 
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
> 
> ---
> 
>  configure.ac | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index b8c183f..e6ae3ce 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -54,15 +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], [
> -	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], [has_libnl_ver=2], [
> +		PKG_CHECK_MODULES([LIBNL], [libnl-1.0], [has_libnl_ver=1], [has_libnl_ver=0])])])

On my ubuntu 10.04, "libnl-1.0" didn't work but "libnl-1" did.

Thanks,
Namhyung


>  if (test "$has_libnl_ver" -eq 0); then
> -	AC_MSG_ERROR(libnl is required but not found)
> +	AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
>  fi
>  if (test "$has_libnl_ver" -gt 1); then
>  	AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])
> 
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop


-- 
Regards,
Namhyung Kim



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2012-11-13 15:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05 10:24 [Powertop] [PATCH] Change library/pkg search condition for libnl2/3 Sergey Senozhatsky
  -- strict thread matches above, loose matches on Subject: below --
2012-11-13 15:30 Namhyung Kim
2012-11-13 10:18 Sergey Senozhatsky
2012-11-13  9:49 Austin Zhang
2012-11-13  9:47 Austin Zhang
2012-11-13  9:26 Sergey Senozhatsky
2012-11-13  9:06 Austin Zhang
2012-11-12  9:09 Sergey Senozhatsky
2012-11-09 15:25 Sergey Senozhatsky
2012-11-09 15:19 Austin Zhang
2012-11-09 13:01 Sergey Senozhatsky
2012-11-09 12:18 Austin Zhang
2012-11-09 12:07 Sergey Senozhatsky
2012-11-09 11:47 Sergey Senozhatsky
2012-11-09 11:43 Austin Zhang
2012-11-09 11:30 Sergey Senozhatsky
2012-11-09 11:17 Austin Zhang
2012-11-09 11:01 Sergey Senozhatsky
2012-11-09 10:56 Austin Zhang
2012-11-08 14:09 Sergey Senozhatsky
2012-11-05 10:51 Sergey Senozhatsky
2012-11-02 14:32 Ferron, Chris E
2012-11-02 12:30 zhang.austin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.