Skip to contentSkip to conversation

Change library/pkg search condition for libnl2/3

PATCH In review zhang.austin at gmail.com 4 participants 23 messages Nov 2, 2012 – Nov 13, 2012

lore
Share & tools
lore

zhang.austin at gmail.com

#0 lore raw

PATCH 1/1 Change library/pkg search condition for libnl2/3

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(-)
configure.ac +2 -2
index b8c183f..ccc0ec5 100644
@@ -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
Signature · 1 line
1.7.5.4
#1 lore raw

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

Quoted 44 lines · 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(-)
configure.ac +2 -3
index b8c183f..ccc0ec5 100644
@@ -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

#2 lore raw

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(-)
configure.ac +4 -6
index b8c183f..cf01279 100644
@@ -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
#3 lore raw

please ignore it. doesn't work.

	-ss
Quoted 35 lines · Sergey Senozhatsky

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(-)
configure.ac +4 -6
index b8c183f..cf01279 100644
@@ -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
#4 lore raw
In reply to Ferron

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(-)
configure.ac +4 -7
index b8c183f..b9c3c2e 100644
@@ -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
#5 lore raw

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>

Quoted 59 lines

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(-)
configure.ac +2 -7
index b8c183f..b9c3c2e 100644
@@ -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

#6 lore raw
Quoted 7 lines · Austin Zhang

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
#7 lore raw

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>

Quoted 21 lines · Austin Zhang
Quoted 4 lines

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

Quoted 3 lines

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
#8 lore raw
Quoted 7 lines · Austin Zhang

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
#9 lore raw
Quoted 1 line

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>

Quoted 39 lines · Austin Zhang
Quoted 7 lines

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
#10 lore raw
Quoted 6 lines · Austin Zhang
Quoted 1 line

�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
Quoted 44 lines

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

#22 lore raw
In reply to Austin Zhang

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(-)
configure.ac +5 -8
index b8c183f..070b126 100644
@@ -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])
#11 lore raw
In reply to Sergey Senozhatsky
Quoted 1 line

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>

Quoted 66 lines · Austin Zhang
Quoted 3 lines
Quoted 1 line

�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

Quoted 3 lines

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
Quoted 13 lines

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
>

Quoted 1 line

so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no

evidence

Quoted 7 lines

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

Quoted 3 lines

for netlink sockets
libnl-nf-3.0 � � � � � � � �libnl-nf - Netfilter Netlink Library libnl-route-3.0 � � � � � � libnl-route - Netlink Routing Family

Library

Quoted 3 lines

libnl-genl-3.0 � � � � � � �libnl-genl - Generic Netlink Library

in case if we remove libnl-genl from PKG_CHECK_MODULES, we'll break

the

Quoted 7 lines

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'

Quoted 10 lines

and so on...

looks like we need to workaround ubuntu.

� � � � -ss

References

Visible links
1. mailto:sergey.senozhatsky(a)gmail.com

#12 lore raw
Quoted 3 lines · Austin Zhang
Quoted 1 line

 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.

Quoted 5 lines

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
Quoted 77 lines

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

#13 lore raw
Quoted 1 line

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

Quoted 1 line

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>

Quoted 129 lines · Austin Zhang
Quoted 1 line
Quoted 1 line

successful configure itself is useless, build is the one that

matters.

Quoted 1 line

Yes, I agree this, I just mean "not install genl is not the excuse of

fail

Quoted 1 line

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.

Quoted 1 line

After double check, in libnl-3 of ubuntu 11.10 (sorry, I wrote it as

11.04

Quoted 4 lines

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
Quoted 6 lines

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

Quoted 6 lines

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

Quoted 2 lines

matters.
if one does not have all requirements for build, failed configure

is ok.

Quoted 4 lines
             -ss

     >    2012/11/9 Sergey Senozhatsky <[1][2]

sergey.senozhatsky(a)gmail.com>

Quoted 4 lines

>
> On (11/09/12 19:17), Austin Zhang wrote:
> > � �libnl3:
> > � �libnl-3.0 � � � � � � � � � � �libnl - Convenience

library

Quoted 5 lines

for
> netlink
> > � �sockets
> > � �libnl2:
> > � �libnl-2.0 � � � � � � � � � � �libnl - Convenience

library

Quoted 7 lines

for
> netlink
> > � �sockets
> >
>
> so, libnl-3.0.pc and libnl-2.0.pc are there, but there are no
evidence

Quoted 8 lines

> 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

Quoted 3 lines

library
> for netlink sockets
> libnl-nf-3.0 � � � � � � � �libnl-nf - Netfilter Netlink

Library

Quoted 1 line

> libnl-route-3.0 � � � � � � libnl-route - Netlink Routing

Family

Quoted 2 lines

Library
> libnl-genl-3.0 � � � � � � �libnl-genl - Generic Netlink

Library

Quoted 29 lines

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

#14 lore raw
Quoted 2 lines · Austin Zhang
Quoted 1 line

is this correct?

I listed it here for your reference.

thanks a lot!
I'll take a look.

	-ss
Quoted 196 lines

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
Quoted 1 line

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

#15 lore raw
In reply to Austin Zhang

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(-)
configure.ac +13 -8
index b8c183f..cee5bf3 100644
@@ -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])
#16 lore raw

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>

Quoted 51 lines

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(-)
configure.ac +6 -7
index b8c183f..cee5bf3 100644
@@ -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

configure.ac +6 -1
+#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])

#17 lore raw
Quoted 7 lines · Austin Zhang

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(-)
configure.ac +13 -8
index b8c183f..0958d73 100644
@@ -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])
#18 lore raw
Quoted 1 line

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.

Quoted 1 line

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

Quoted 64 lines · Austin Zhang
Quoted 7 lines

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(-)
configure.ac +6 -7
index b8c183f..0958d73 100644
@@ -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

configure.ac +6 -1
+#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])

#19 lore raw

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>

Quoted 84 lines
Quoted 1 line

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.

Quoted 1 line

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

Quoted 68 lines · Austin Zhang
Quoted 7 lines

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(-)
configure.ac +0 -0
index b8c183f..0958d73 100644
@@ -54,15 +54,20 @@ PKG_CHECK_MODULES([PCIUTILS],

[libpci],[has_libpci=1],[

has_libnl_ver=0

configure.ac +0 -7
-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], [])])])])

configure.ac +3 -0
+
+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])])])

configure.ac +2 -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

configure.ac +6 -1
+#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])

#20 lore raw
In reply to Austin Zhang
Quoted 11 lines · Austin Zhang
Quoted 2 lines

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.

Quoted 1 line

+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(-)
configure.ac +4 -8
index b8c183f..e6ae3ce 100644
@@ -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])
#21 lore raw

2012-11-13 (화), 13:18 +0300, Sergey Senozhatsky:

Quoted 35 lines · Austin Zhang
Quoted 11 lines
Quoted 2 lines

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.

Quoted 1 line

+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(-)
configure.ac +0 -0
index b8c183f..e6ae3ce 100644
@@ -54,15 +54,11 @@ PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[
 
 
 has_libnl_ver=0

configure.ac PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[ · line 59

Quoted 10 lines
configure.ac +3 -7
-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

Quoted 11 lines
configure.ac +1 -1
 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

Signature · 2 lines
Regards,
Namhyung Kim