Patchwork [v2] lowpan-tools_0.2.2;: fix build with static libnl1

login
register
mail settings
Submitter Anders Darander
Date April 10, 2011, 5:27 p.m.
Message ID <1302456441-3417-1-git-send-email-anders@chargestorm.se>
Download mbox | patch
Permalink /patch/2123/
State Rejected
Headers show

Comments

Anders Darander - April 10, 2011, 5:27 p.m.
* add NL_CFLAGS to a few Makefiles.am
* git version not fixed
* build and runtime tested, although only in qemuarm

Signed-off-by: Anders Darander <anders@chargestorm.se>
---
 .../0001-Add-NL_CFLAGS-to-libcommon.patch          |   65 ++++++++++++++++++++
 recipes/lowpan-tools/lowpan-tools.inc              |    4 +-
 recipes/lowpan-tools/lowpan-tools_0.2.2.bb         |    6 ++-
 3 files changed, 72 insertions(+), 3 deletions(-)
 create mode 100644 recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch
Anders Darander - April 10, 2011, 6:07 p.m.
Hi,

I'm replying to my own mail...
This patch is intended for th org.openembedded.dev branch, as it
requires the libnl -> libnl1 patch by Martin Jansa, wich is applied to
that branch.

This to solves the problem of using lowpan-tools on a system which
otherwise uses libnl2.

* Anders Darander <anders@chargestorm.se> [110410 19:27]:
> * add NL_CFLAGS to a few Makefiles.am
> * git version not fixed
> * build and runtime tested, although only in qemuarm

I forgot to mention that the difference between v2 and v1, is that I
forgot to update PR in the first version. This is corrected in the
current version.

I hope that this patch can be ACK'ed and pushed.

Regards,
Anders
Martin Jansa - April 11, 2011, 8:01 a.m.
On Sun, Apr 10, 2011 at 07:27:21PM +0200, Anders Darander wrote:
> * add NL_CFLAGS to a few Makefiles.am

look like adding -D_GNU_SOURCE not $(NL_CFLAGS) except iplink/Makefile.am 
and lib/Makefile.am, why was -D_GNU_SOURCE needed?

and lowpan-tools_0.2.2.bb gets PR bump from INC_PR, no need to bump .1
too.

but otherwise looks ok (I haven't tested it - never used lowpan-tools).

Regards,

> * git version not fixed
> * build and runtime tested, although only in qemuarm
> 
> Signed-off-by: Anders Darander <anders@chargestorm.se>
> ---
>  .../0001-Add-NL_CFLAGS-to-libcommon.patch          |   65 ++++++++++++++++++++
>  recipes/lowpan-tools/lowpan-tools.inc              |    4 +-
>  recipes/lowpan-tools/lowpan-tools_0.2.2.bb         |    6 ++-
>  3 files changed, 72 insertions(+), 3 deletions(-)
>  create mode 100644 recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch
> 
> diff --git a/recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch b/recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch
> new file mode 100644
> index 0000000..45cc4d0
> --- /dev/null
> +++ b/recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch
> @@ -0,0 +1,65 @@
> +From 7fa435ea775b1410d9ccb95d2e315847f5a0f09c Mon Sep 17 00:00:00 2001
> +From: Anders Darander <anders@chargestorm.se>
> +Date: Tue, 5 Apr 2011 20:24:54 +0200
> +Subject: [PATCH] Add-NL_CFLAGS-to-libcommon
> +
> +Signed-off-by: Anders Darander <anders@chargestorm.se>
> +---
> + iplink/Makefile.am |    1 +
> + lib/Makefile.am    |    1 +
> + src/Makefile.am    |    4 ++--
> + tests/Makefile.am  |    2 +-
> + 4 files changed, 5 insertions(+), 3 deletions(-)
> +
> +diff --git a/iplink/Makefile.am b/iplink/Makefile.am
> +index bbed7ba..6e87ae0 100644
> +--- a/iplink/Makefile.am
> ++++ b/iplink/Makefile.am
> +@@ -4,3 +4,4 @@ noinst_HEADERS = iplink.h
> + iproute_LTLIBRARIES = link_wpan.la
> + link_wpan_la_LDFLAGS = -module -avoid-version -shared
> + 
> ++link_wpan_la_CFLAGS = $(NL_CFLAGS) -D_GNU_SOURCE
> +\ No newline at end of file
> +diff --git a/lib/Makefile.am b/lib/Makefile.am
> +index 5e15018..6936ebb 100644
> +--- a/lib/Makefile.am
> ++++ b/lib/Makefile.am
> +@@ -3,3 +3,4 @@ include $(top_srcdir)/Makefile.common
> + noinst_LTLIBRARIES = libcommon.la
> + libcommon_la_SOURCES = printbuf.c genl.c parse.c shash.c logging.c nl_policy.c
> + 
> ++libcommon_la_CFLAGS = $(NL_CFLAGS) -D_GNU_SOURCE
> +diff --git a/src/Makefile.am b/src/Makefile.am
> +index 555e214..46c4017 100644
> +--- a/src/Makefile.am
> ++++ b/src/Makefile.am
> +@@ -20,11 +20,11 @@ iz_SOURCES = iz.c iz-common.c iz-mac.c iz-phy.c
> + noinst_HEADERS = iz.h
> + 
> + izcoordinator_SOURCES = coordinator.c
> +-izcoordinator_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -DLEASE_FILE=\"$(leasefile)\"
> ++izcoordinator_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -DLEASE_FILE=\"$(leasefile)\" -D_GNU_SOURCE
> + izcoordinator_CFLAGS += -DPID_FILE=\"$(pidfile)\"
> + izcoordinator_LDADD = ../addrdb/libaddrdb.la $(LDADD) $(NL_LIBS) $(LEXLIB)
> + 
> +-iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS)
> ++iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE
> + iz_LDADD = $(LDADD) $(NL_LIBS)
> + 
> + izattach.8: $(izattach_SOURCES) $(top_srcdir)/configure.ac
> +diff --git a/tests/Makefile.am b/tests/Makefile.am
> +index d491be5..00621ca 100644
> +--- a/tests/Makefile.am
> ++++ b/tests/Makefile.am
> +@@ -4,6 +4,6 @@ zbtest_PROGRAMS = listen-packet test test2 test3 test4 test5 test6 test7 gnl izl
> + 
> + izlisten_SOURCES = listen.c
> + 
> +-gnl_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS)
> ++gnl_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE
> + gnl_LDADD = $(LDADD) $(NL_LIBS)
> + 
> +-- 
> +1.7.4.1
> +
> diff --git a/recipes/lowpan-tools/lowpan-tools.inc b/recipes/lowpan-tools/lowpan-tools.inc
> index f429f96..94faf9c 100644
> --- a/recipes/lowpan-tools/lowpan-tools.inc
> +++ b/recipes/lowpan-tools/lowpan-tools.inc
> @@ -1,7 +1,7 @@
>  DESCRIPTION = "LoWPAN utilities (IEEE802.15.4)"
>  LICENSE = "GPLv2"
> -DEPENDS = "libnl bison-native flex-native python-native"
> -INC_PR = "r11"
> +DEPENDS = "libnl1 bison-native flex-native python-native"
> +INC_PR = "r12"
>  
>  SRC_URI = "http://prdownloads.sourceforge.net/linux-zigbee/linux-zigbee-sources/${PV}/lowpan-tools-${PV}.tar.gz"
>  
> diff --git a/recipes/lowpan-tools/lowpan-tools_0.2.2.bb b/recipes/lowpan-tools/lowpan-tools_0.2.2.bb
> index 5686487..103109e 100644
> --- a/recipes/lowpan-tools/lowpan-tools_0.2.2.bb
> +++ b/recipes/lowpan-tools/lowpan-tools_0.2.2.bb
> @@ -1,6 +1,10 @@
>  require lowpan-tools.inc
>  
> -PR = "${INC_PR}.0"
> +PR = "${INC_PR}.1"
> +
> +SRC_URI_append = " \
> +      file://0001-Add-NL_CFLAGS-to-libcommon.patch \
> +      "
>  
>  EXTRA_OECONF = "--enable-ip-plugin"
>  
> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Anders Darander - April 11, 2011, 9:08 a.m.
On 11 apr 2011, at 10:02, "Martin Jansa" <martin.jansa@gmail.com> wrote:

> On Sun, Apr 10, 2011 at 07:27:21PM +0200, Anders Darander wrote:
>> * add NL_CFLAGS to a few Makefiles.am
> 
> look like adding -D_GNU_SOURCE not $(NL_CFLAGS) except iplink/Makefile.am 
> and lib/Makefile.am, why was -D_GNU_SOURCE needed?

Hm, I should probably update that patch description to reflect that NL_CFLAGS is only added on a couple of places, while _GNU_SOURCE is added on a few more places.

-D_GNU_SOURCE was added as otherwise a struct, ucred if I remember correctly, was undefined. (I don't currently have access to that computer.)

> and lowpan-tools_0.2.2.bb gets PR bump from INC_PR, no need to bump .1
> too.

Ok, I bumped PR in lowpan-tools_0.2.2.bb as I modified that file also...

> but otherwise looks ok (I haven't tested it - never used lowpan-tools).
> 

I'll try to make a somewhat better explanation in the included patch during the evening, and I can also remove the PR bump before submitting a third revision of the patch. Hopefully I can find some time this evening.
 
Regards,
Anders
Stefan Schmidt - April 11, 2011, 10:57 a.m.
Hello.

On Mon, 2011-04-11 at 11:08, Anders Darander wrote:
> 
> 
> On 11 apr 2011, at 10:02, "Martin Jansa" <martin.jansa@gmail.com> wrote:
> 
> > On Sun, Apr 10, 2011 at 07:27:21PM +0200, Anders Darander wrote:
> >> * add NL_CFLAGS to a few Makefiles.am
> > 
> > look like adding -D_GNU_SOURCE not $(NL_CFLAGS) except iplink/Makefile.am 
> > and lib/Makefile.am, why was -D_GNU_SOURCE needed?
> 
> Hm, I should probably update that patch description to reflect that NL_CFLAGS is only added on a couple of places, while _GNU_SOURCE is added on a few more places.
> 
> -D_GNU_SOURCE was added as otherwise a struct, ucred if I remember correctly, was undefined. (I don't currently have access to that computer.)
> 
> > and lowpan-tools_0.2.2.bb gets PR bump from INC_PR, no need to bump .1
> > too.
> 
> Ok, I bumped PR in lowpan-tools_0.2.2.bb as I modified that file also...
> 
> > but otherwise looks ok (I haven't tested it - never used lowpan-tools).
> > 
> 
> I'll try to make a somewhat better explanation in the included patch during the evening, and I can also remove the PR bump before submitting a third revision of the patch. Hopefully I can find some time this evening.

Thanks for this. I will test your patch and push it out after this.

While I still want to get lowpan-tools fixed for libnl2 I think this
is a good solution for the current releases.

regards
Stefan Schmidt
Anders Darander - April 11, 2011, 11:29 a.m.
Hi,

On Mon, Apr 11, 2011 at 12:57, Stefan Schmidt <stefan@datenfreihafen.org> wrote:
> On Mon, 2011-04-11 at 11:08, Anders Darander wrote:
>> I'll try to make a somewhat better explanation in the included patch during the evening, and I can also remove the PR bump before submitting a third revision of the patch. Hopefully I can find some time this evening.
>
> Thanks for this. I will test your patch and push it out after this.

Thanks, I make sure to send a v3 this evening (at the latest tomorrow evening).

> While I still want to get lowpan-tools fixed for libnl2 I think this
> is a good solution for the current releases.

Yes, I agree with you that the correct fix is to update lowpan-tools
to use libnl2. However, due to time constraints, we opted for the
interim solution.

Regards,
Anders
Stefan Schmidt - April 11, 2011, 11:41 a.m.
Hello.

On Mon, 2011-04-11 at 13:29, Anders Darander wrote:
> 
> On Mon, Apr 11, 2011 at 12:57, Stefan Schmidt <stefan@datenfreihafen.org> wrote:
> > On Mon, 2011-04-11 at 11:08, Anders Darander wrote:
> >> I'll try to make a somewhat better explanation in the included patch during the evening, and I can also remove the PR bump before submitting a third revision of the patch. Hopefully I can find some time this evening.
> >
> > Thanks for this. I will test your patch and push it out after this.
> 
> Thanks, I make sure to send a v3 this evening (at the latest tomorrow evening).

Thanks

> > While I still want to get lowpan-tools fixed for libnl2 I think this
> > is a good solution for the current releases.
> 
> Yes, I agree with you that the correct fix is to update lowpan-tools
> to use libnl2. However, due to time constraints, we opted for the
> interim solution.

Yup, no problem. I'm going to touch the ieee802154 kernel stack and
maybe lowpan-tools the next weeks anyway I will try to squeeze in the
change to libnl2.

regards
Stefan Schmidt
Anders Darander - April 11, 2011, 5:44 p.m.
Hi,

A third version has just been posted.

* Stefan Schmidt <stefan@datenfreihafen.org> [110411 13:41]:
> On Mon, 2011-04-11 at 13:29, Anders Darander wrote:
> > Yes, I agree with you that the correct fix is to update lowpan-tools
> > to use libnl2. However, due to time constraints, we opted for the
> > interim solution.

> Yup, no problem. I'm going to touch the ieee802154 kernel stack and
> maybe lowpan-tools the next weeks anyway I will try to squeeze in the
> change to libnl2.

Good news, such a change will definitely be appreciated. We had the same
idea, however, we won't be able to find the time for it for quite a
while...

Regarding your work touching the ieee802154 kernel stack, is the version
from the linux-zigbee-kernel tree? Or is it something getting mainlined?
We are currently in a prototype phase, especially when it comes to
zigbee, and both kernel version and additional kernel patches are
open...

Regards,
Anders
Stefan Schmidt - April 12, 2011, 7:18 a.m.
Hello.

On Mon, 2011-04-11 at 19:44, Anders Darander wrote:
> 
> A third version has just been posted.
> 
> * Stefan Schmidt <stefan@datenfreihafen.org> [110411 13:41]:
> > On Mon, 2011-04-11 at 13:29, Anders Darander wrote:
> > > Yes, I agree with you that the correct fix is to update lowpan-tools
> > > to use libnl2. However, due to time constraints, we opted for the
> > > interim solution.
> 
> > Yup, no problem. I'm going to touch the ieee802154 kernel stack and
> > maybe lowpan-tools the next weeks anyway I will try to squeeze in the
> > change to libnl2.
> 
> Good news, such a change will definitely be appreciated. We had the same
> idea, however, we won't be able to find the time for it for quite a
> while...
> 
> Regarding your work touching the ieee802154 kernel stack, is the version
> from the linux-zigbee-kernel tree? Or is it something getting mainlined?
> We are currently in a prototype phase, especially when it comes to
> zigbee, and both kernel version and additional kernel patches are
> open...

Taking this off list as it does not have anything to do with OE.

regards
Stefan Schmidt

Patch

diff --git a/recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch b/recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch
new file mode 100644
index 0000000..45cc4d0
--- /dev/null
+++ b/recipes/lowpan-tools/lowpan-tools-0.2.2/0001-Add-NL_CFLAGS-to-libcommon.patch
@@ -0,0 +1,65 @@ 
+From 7fa435ea775b1410d9ccb95d2e315847f5a0f09c Mon Sep 17 00:00:00 2001
+From: Anders Darander <anders@chargestorm.se>
+Date: Tue, 5 Apr 2011 20:24:54 +0200
+Subject: [PATCH] Add-NL_CFLAGS-to-libcommon
+
+Signed-off-by: Anders Darander <anders@chargestorm.se>
+---
+ iplink/Makefile.am |    1 +
+ lib/Makefile.am    |    1 +
+ src/Makefile.am    |    4 ++--
+ tests/Makefile.am  |    2 +-
+ 4 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/iplink/Makefile.am b/iplink/Makefile.am
+index bbed7ba..6e87ae0 100644
+--- a/iplink/Makefile.am
++++ b/iplink/Makefile.am
+@@ -4,3 +4,4 @@ noinst_HEADERS = iplink.h
+ iproute_LTLIBRARIES = link_wpan.la
+ link_wpan_la_LDFLAGS = -module -avoid-version -shared
+ 
++link_wpan_la_CFLAGS = $(NL_CFLAGS) -D_GNU_SOURCE
+\ No newline at end of file
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 5e15018..6936ebb 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -3,3 +3,4 @@ include $(top_srcdir)/Makefile.common
+ noinst_LTLIBRARIES = libcommon.la
+ libcommon_la_SOURCES = printbuf.c genl.c parse.c shash.c logging.c nl_policy.c
+ 
++libcommon_la_CFLAGS = $(NL_CFLAGS) -D_GNU_SOURCE
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 555e214..46c4017 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -20,11 +20,11 @@ iz_SOURCES = iz.c iz-common.c iz-mac.c iz-phy.c
+ noinst_HEADERS = iz.h
+ 
+ izcoordinator_SOURCES = coordinator.c
+-izcoordinator_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -DLEASE_FILE=\"$(leasefile)\"
++izcoordinator_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -DLEASE_FILE=\"$(leasefile)\" -D_GNU_SOURCE
+ izcoordinator_CFLAGS += -DPID_FILE=\"$(pidfile)\"
+ izcoordinator_LDADD = ../addrdb/libaddrdb.la $(LDADD) $(NL_LIBS) $(LEXLIB)
+ 
+-iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS)
++iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE
+ iz_LDADD = $(LDADD) $(NL_LIBS)
+ 
+ izattach.8: $(izattach_SOURCES) $(top_srcdir)/configure.ac
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index d491be5..00621ca 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -4,6 +4,6 @@ zbtest_PROGRAMS = listen-packet test test2 test3 test4 test5 test6 test7 gnl izl
+ 
+ izlisten_SOURCES = listen.c
+ 
+-gnl_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS)
++gnl_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE
+ gnl_LDADD = $(LDADD) $(NL_LIBS)
+ 
+-- 
+1.7.4.1
+
diff --git a/recipes/lowpan-tools/lowpan-tools.inc b/recipes/lowpan-tools/lowpan-tools.inc
index f429f96..94faf9c 100644
--- a/recipes/lowpan-tools/lowpan-tools.inc
+++ b/recipes/lowpan-tools/lowpan-tools.inc
@@ -1,7 +1,7 @@ 
 DESCRIPTION = "LoWPAN utilities (IEEE802.15.4)"
 LICENSE = "GPLv2"
-DEPENDS = "libnl bison-native flex-native python-native"
-INC_PR = "r11"
+DEPENDS = "libnl1 bison-native flex-native python-native"
+INC_PR = "r12"
 
 SRC_URI = "http://prdownloads.sourceforge.net/linux-zigbee/linux-zigbee-sources/${PV}/lowpan-tools-${PV}.tar.gz"
 
diff --git a/recipes/lowpan-tools/lowpan-tools_0.2.2.bb b/recipes/lowpan-tools/lowpan-tools_0.2.2.bb
index 5686487..103109e 100644
--- a/recipes/lowpan-tools/lowpan-tools_0.2.2.bb
+++ b/recipes/lowpan-tools/lowpan-tools_0.2.2.bb
@@ -1,6 +1,10 @@ 
 require lowpan-tools.inc
 
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
+
+SRC_URI_append = " \
+      file://0001-Add-NL_CFLAGS-to-libcommon.patch \
+      "
 
 EXTRA_OECONF = "--enable-ip-plugin"