2011-04-28 08:14:12

by Yegor Yefremov

[permalink] [raw]
Subject: [PATCH] iw: add libnl-3.0 support

Extend Makefile to find and use libnl-3.0

Signed-off-by: Yegor Yefremov <[email protected]>
---
Makefile | 10 ++++++++++
1 file changed, 10 insertions(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@

NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
+NL3FOUND := $(shell $(PKG_CONFIG) --atleast-version=3 libnl-3.0 && echo Y)

ifeq ($(NL1FOUND),Y)
NLLIBNAME = libnl-1
@@ -35,6 +36,12 @@
NLLIBNAME = libnl-2.0
endif

+ifeq ($(NL3FOUND),Y)
+CFLAGS += -DCONFIG_LIBNL20
+LIBS += -lnl-genl
+NLLIBNAME = libnl-3.0
+endif
+
ifeq ($(NLLIBNAME),)
$(error Cannot find development files for any supported version of libnl)
endif
@@ -53,6 +60,8 @@
all: version_check $(ALL)

version_check:
+ifeq ($(NL3FOUND),Y)
+else
ifeq ($(NL2FOUND),Y)
else
ifeq ($(NL1FOUND),Y)
@@ -60,6 +69,7 @@
$(error No libnl found)
endif
endif
+endif


VERSION_OBJS := $(filter-out version.o, $(OBJS))



2011-04-28 09:12:25

by Sedat Dilek

[permalink] [raw]
Subject: Re: [PATCH] iw: add libnl-3.0 support

On Thu, Apr 28, 2011 at 9:48 AM, Yegor Yefremov
<[email protected]> wrote:
> Extend Makefile to find and use libnl-3.0
>
> Signed-off-by: Yegor Yefremov <[email protected]>
> ---
>  Makefile |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> Index: b/Makefile
> ===================================================================
> --- a/Makefile
> +++ b/Makefile
> @@ -24,6 +24,7 @@
>
>  NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
>  NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
> +NL3FOUND := $(shell $(PKG_CONFIG) --atleast-version=3 libnl-3.0 && echo Y)
>
>  ifeq ($(NL1FOUND),Y)
>  NLLIBNAME = libnl-1
> @@ -35,6 +36,12 @@
>  NLLIBNAME = libnl-2.0
>  endif
>
> +ifeq ($(NL3FOUND),Y)
> +CFLAGS += -DCONFIG_LIBNL20
> +LIBS += -lnl-genl
> +NLLIBNAME = libnl-3.0
> +endif
> +

Is this intended -DCONFIG_LIBNL**2**0 and NLLIBNAME = libnl-**3**.0?

- Sedat -

>  ifeq ($(NLLIBNAME),)
>  $(error Cannot find development files for any supported version of libnl)
>  endif
> @@ -53,6 +60,8 @@
>  all: version_check $(ALL)
>
>  version_check:
> +ifeq ($(NL3FOUND),Y)
> +else
>  ifeq ($(NL2FOUND),Y)
>  else
>  ifeq ($(NL1FOUND),Y)
> @@ -60,6 +69,7 @@
>        $(error No libnl found)
>  endif
>  endif
> +endif
>
>
>  VERSION_OBJS := $(filter-out version.o, $(OBJS))
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

2011-04-28 09:25:31

by Yegor Yefremov

[permalink] [raw]
Subject: Re: [PATCH] iw: add libnl-3.0 support


>> Extend Makefile to find and use libnl-3.0
>>
>> Signed-off-by: Yegor Yefremov <[email protected]>
>> ---
>> Makefile | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> Index: b/Makefile
>> ===================================================================
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -24,6 +24,7 @@
>>
>> NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
>> NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
>> +NL3FOUND := $(shell $(PKG_CONFIG) --atleast-version=3 libnl-3.0 && echo Y)
>>
>> ifeq ($(NL1FOUND),Y)
>> NLLIBNAME = libnl-1
>> @@ -35,6 +36,12 @@
>> NLLIBNAME = libnl-2.0
>> endif
>>
>> +ifeq ($(NL3FOUND),Y)
>> +CFLAGS += -DCONFIG_LIBNL20
>> +LIBS += -lnl-genl
>> +NLLIBNAME = libnl-3.0
>> +endif
>> +
> Is this intended -DCONFIG_LIBNL**2**0 and NLLIBNAME = libnl-**3**.0?
>
> - Sedat -

There is no such config option as CONFIG_LIBNL30. AFAIK the interface has not been changed since 2.0, so it compiles without errors and I haven't encountered any problems while running iw with libnl-3.0.

Best regards,
Yegor



2011-07-20 19:27:07

by Berg, Johannes

[permalink] [raw]
Subject: Re: [PATCH] iw: add libnl-3.0 support

T24gV2VkLCAyMDExLTA3LTIwIGF0IDEyOjE5ICswMjAwLCBZZWdvciBZZWZyZW1vdiB3cm90ZToK
Cj4gPiAraWZlcSAoJChOTDNGT1VORCksWSkKPiA+ICtDRkxBR1MgKz0gLURDT05GSUdfTElCTkwy
MAo+ID4gK0xJQlMgKz0gLWxubC1nZW5sCj4gPiArTkxMSUJOQU1FID0gbGlibmwtMy4wCj4gPiAr
ZW5kaWYKCkknZCBwcmVmZXIgaWYgeW91IGRpZCAtRENPTkZJR19MSUJOTDMwIGFuZCBhZGRlZCB0
aGUgY29ycmVjdCBpZmRlZnMKKHBsZWFzZSBtYWtlIGl0ICNpZiBkZWZpbmVkKC4uLikgfHwgZGVm
aW5lZCguLi4pKQoKam9oYW5uZXMKCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCkludGVs
IEdtYkgKRG9ybmFjaGVyIFN0cmFzc2UgMQo4NTYyMiBGZWxka2lyY2hlbi9NdWVuY2hlbiwgRGV1
dHNjaGxhbmQgClNpdHogZGVyIEdlc2VsbHNjaGFmdDogRmVsZGtpcmNoZW4gYmVpIE11ZW5jaGVu
Ckdlc2NoYWVmdHNmdWVocmVyOiBEb3VnbGFzIEx1c2ssIFBldGVyIEdsZWlzc25lciwgSGFubmVz
IFNjaHdhZGVyZXIKUmVnaXN0ZXJnZXJpY2h0OiBNdWVuY2hlbiBIUkIgNDc0NTYgClVzdC4tSWRO
ci4vVkFUIFJlZ2lzdHJhdGlvbiBOby46IERFMTI5Mzg1ODk1CkNpdGliYW5rIEZyYW5rZnVydCBh
Lk0uIChCTFogNTAyIDEwOSAwMCkgNjAwMTE5MDUyCg==


2011-07-20 10:52:25

by Yegor Yefremov

[permalink] [raw]
Subject: Re: [PATCH] iw: add libnl-3.0 support

Hi Johannes,

Am 28.04.2011 09:48, schrieb Yegor Yefremov:
> Extend Makefile to find and use libnl-3.0
>
> Signed-off-by: Yegor Yefremov <[email protected]>
> ---
> Makefile | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> Index: b/Makefile
> ===================================================================
> --- a/Makefile
> +++ b/Makefile
> @@ -24,6 +24,7 @@
>
> NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
> NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
> +NL3FOUND := $(shell $(PKG_CONFIG) --atleast-version=3 libnl-3.0 && echo Y)
>
> ifeq ($(NL1FOUND),Y)
> NLLIBNAME = libnl-1
> @@ -35,6 +36,12 @@
> NLLIBNAME = libnl-2.0
> endif
>
> +ifeq ($(NL3FOUND),Y)
> +CFLAGS += -DCONFIG_LIBNL20
> +LIBS += -lnl-genl
> +NLLIBNAME = libnl-3.0
> +endif
> +
> ifeq ($(NLLIBNAME),)
> $(error Cannot find development files for any supported version of libnl)
> endif
> @@ -53,6 +60,8 @@
> all: version_check $(ALL)
>
> version_check:
> +ifeq ($(NL3FOUND),Y)
> +else
> ifeq ($(NL2FOUND),Y)
> else
> ifeq ($(NL1FOUND),Y)
> @@ -60,6 +69,7 @@
> $(error No libnl found)
> endif
> endif
> +endif
>
>
> VERSION_OBJS := $(filter-out version.o, $(OBJS))
>

could you please review the patch?

Thanks.

Yegor

2011-07-21 15:09:25

by Yegor Yefremov

[permalink] [raw]
Subject: Re: [PATCH] iw: add libnl-3.0 support

Am 20.07.2011 21:27, schrieb Johannes Berg:
> On Wed, 2011-07-20 at 12:19 +0200, Yegor Yefremov wrote:
>
>>> +ifeq ($(NL3FOUND),Y)
>>> +CFLAGS += -DCONFIG_LIBNL20
>>> +LIBS += -lnl-genl
>>> +NLLIBNAME = libnl-3.0
>>> +endif
> I'd prefer if you did -DCONFIG_LIBNL30 and added the correct ifdefs
> (please make it #if defined(...) || defined(...))

O.K. I made the changes (see v2). The code excluded, if LIBNL20 is detected, was actually libnl 1.x compatibility code and not libnl 2.0 compatibility code. Do I see it right?

Yegor