linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iw: add libnl-3.0 support
@ 2011-07-21 15:06 Yegor Yefremov
  2011-07-29  7:24 ` Yegor Yefremov
  0 siblings, 1 reply; 2+ messages in thread
From: Yegor Yefremov @ 2011-07-21 15:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
Changes from v1:
- CONFIG_LIBNL30 added

 Makefile |   10 ++++++++++
 iw.c     |    7 +++----
 iw.h     |    3 ++-
 3 files changed, 15 insertions(+), 5 deletions(-)

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_LIBNL30
+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))
Index: b/iw.c
===================================================================
--- a/iw.c
+++ b/iw.c
@@ -23,9 +23,8 @@
 #include "nl80211.h"
 #include "iw.h"
 
-#ifndef CONFIG_LIBNL20
-/* libnl 2.0 compatibility code */
-
+/* libnl 1.x compatibility code */
+#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
 static inline struct nl_handle *nl_socket_alloc(void)
 {
 	return nl_handle_alloc();
@@ -45,7 +44,7 @@
 	return 0;
 }
 #define genl_ctrl_alloc_cache __genl_ctrl_alloc_cache
-#endif /* CONFIG_LIBNL20 */
+#endif /* CONFIG_LIBNL20 && CONFIG_LIBNL30 */
 
 int iw_debug = 0;
 
Index: b/iw.h
===================================================================
--- a/iw.h
+++ b/iw.h
@@ -11,7 +11,8 @@
 
 #define ETH_ALEN 6
 
-#ifndef CONFIG_LIBNL20
+/* libnl 1.x compatibility code */
+#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
 #  define nl_sock nl_handle
 #endif
 


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

* Re: [PATCH v2] iw: add libnl-3.0 support
  2011-07-21 15:06 [PATCH v2] iw: add libnl-3.0 support Yegor Yefremov
@ 2011-07-29  7:24 ` Yegor Yefremov
  0 siblings, 0 replies; 2+ messages in thread
From: Yegor Yefremov @ 2011-07-29  7:24 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Am 21.07.2011 17:06, schrieb Yegor Yefremov:
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> Changes from v1:
> - CONFIG_LIBNL30 added
> 
>  Makefile |   10 ++++++++++
>  iw.c     |    7 +++----
>  iw.h     |    3 ++-
>  3 files changed, 15 insertions(+), 5 deletions(-)
> 
> 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_LIBNL30
> +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))
> Index: b/iw.c
> ===================================================================
> --- a/iw.c
> +++ b/iw.c
> @@ -23,9 +23,8 @@
>  #include "nl80211.h"
>  #include "iw.h"
>  
> -#ifndef CONFIG_LIBNL20
> -/* libnl 2.0 compatibility code */
> -
> +/* libnl 1.x compatibility code */
> +#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
>  static inline struct nl_handle *nl_socket_alloc(void)
>  {
>  	return nl_handle_alloc();
> @@ -45,7 +44,7 @@
>  	return 0;
>  }
>  #define genl_ctrl_alloc_cache __genl_ctrl_alloc_cache
> -#endif /* CONFIG_LIBNL20 */
> +#endif /* CONFIG_LIBNL20 && CONFIG_LIBNL30 */
>  
>  int iw_debug = 0;
>  
> Index: b/iw.h
> ===================================================================
> --- a/iw.h
> +++ b/iw.h
> @@ -11,7 +11,8 @@
>  
>  #define ETH_ALEN 6
>  
> -#ifndef CONFIG_LIBNL20
> +/* libnl 1.x compatibility code */
> +#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
>  #  define nl_sock nl_handle
>  #endif
>  
> 

Is the patch correct now? 

At the time this is the only patch needed to integrate this package in buildroot.

Yegor

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

end of thread, other threads:[~2011-07-29  7:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21 15:06 [PATCH v2] iw: add libnl-3.0 support Yegor Yefremov
2011-07-29  7:24 ` Yegor Yefremov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).