Skip to contentSkip to conversation

zeromq: add C++ bindings

PATCH New spdawson at gmail.com 4 participants 7 messages Mar 18, 2013 – Mar 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zeromq: add C++ bindings

From: Simon Dawson <[email protected]>

Now that zeromq has been bumped to version 3.2.2, we need to provide the C++ bindings using separate packages. Two C++ bindings are provided by this patch:

* cppzmq is a very simple single-header binding
* zmqpp is a high-level binding, implemented in C++ as a separate library

When the new "C++ bindings" option for zeromq is selected, both of these C++ bindings are built and installed.

---
 package/Config.in        |    2 ++
 package/cppzmq/Config.in |    2 ++
 package/cppzmq/cppzmq.mk |   23 ++++++++++++++++++++++
 package/zeromq/Config.in |   17 +++++++++++++---
 package/zmqpp/Config.in  |    2 ++
 package/zmqpp/zmqpp.mk   |   48 ++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 91 insertions(+), 3 deletions(-)
 create mode 100644 package/cppzmq/Config.in
 create mode 100644 package/cppzmq/cppzmq.mk
 create mode 100644 package/zmqpp/Config.in
 create mode 100644 package/zmqpp/zmqpp.mk
package/Config.in +2 -0
index 9853b06..9519852 100644
@@ -495,6 +495,7 @@ source "package/mediastreamer/Config.in"
 endmenu
 
 menu "Networking"
+source "package/cppzmq/Config.in"
 source "package/glib-networking/Config.in"
 source "package/libcgi/Config.in"
 source "package/libcgicc/Config.in"
@@ -535,6 +536,7 @@ source "package/ortp/Config.in"
 source "package/slirp/Config.in"
 source "package/usbredir/Config.in"
 source "package/zeromq/Config.in"
+source "package/zmqpp/Config.in"
 endmenu
 
 menu "Other"
package/cppzmq/Config.in new file +2 -0
new file mode 100644
index 0000000..6ec168e
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_CPPZMQ
+	bool
package/cppzmq/cppzmq.mk new file +23 -0
new file mode 100644
index 0000000..b4540ca
@@ -0,0 +1,23 @@
+#############################################################
+#
+# cppzmq
+#
+#############################################################
+
+CPPZMQ_VERSION = b232978
+CPPZMQ_SITE = git://github.com/zeromq/cppzmq.git
+CPPZMQ_INSTALL_STAGING = YES
+CPPZMQ_INSTALL_TARGET = NO
+CPPZMQ_DEPENDENCIES = zeromq
+CPPZMQ_LICENSE = MIT
+CPPZMQ_LICENSE_FILES = zmq.hpp
+
+define CPPZMQ_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 0644 -D $(@D)/zmq.hpp $(STAGING_DIR)/usr/include/zmq.hpp
+endef
+
+define CPPZMQ_UNINSTALL_STAGING_CMDS
+	$(RM) $(STAGING_DIR)/usr/include/zmq.hpp
+endef
+
+$(eval $(generic-package))
package/zeromq/Config.in +14 -3
index b7dc8a6..db2384e 100644
@@ -1,9 +1,8 @@
-comment "zeromq requires a toolchain with C++, LARGEFILE + WCHAR support"
-	depends on !(BR2_INSTALL_LIBSTDCPP &&  BR2_LARGEFILE && BR2_USE_WCHAR)
+comment "zeromq requires a toolchain with LARGEFILE and WCHAR support"
+	depends on !(BR2_LARGEFILE && BR2_USE_WCHAR)
 
 config BR2_PACKAGE_ZEROMQ
 	bool "zeromq"
-	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_LARGEFILE # util-linux
 	depends on BR2_USE_WCHAR # util-linux
 	select BR2_PACKAGE_UTIL_LINUX
@@ -32,3 +31,15 @@ config BR2_PACKAGE_ZEROMQ_PGM
 	  Add support for Pragmatic General Multicast protocol (RFC 3208)
 	  implemented either over raw IP packets or UDP datagrams
 	  (encapsulated PGM). This requires OpenPGM library.
+
+comment "zeromq C++ bindings require a toolchain with C++ support"
+	depends on BR2_PACKAGE_ZEROMQ && !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_ZEROMQ_CPP
+	bool "C++ bindings"
+	depends on BR2_PACKAGE_ZEROMQ
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_CPPZMQ
+	select BR2_PACKAGE_ZMQPP
+	help
+	  C++ bindings.
package/zmqpp/Config.in new file +2 -0
new file mode 100644
index 0000000..954cf29
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_ZMQPP
+	bool
package/zmqpp/zmqpp.mk new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 zeromq: add C++ bindings

Hi Simon,

Quoted 14 lines · spdawson at gmail.com

From: Simon Dawson <[email protected]>

Now that zeromq has been bumped to version 3.2.2, we need to provide the C++ bindings using separate packages. Two C++ bindings are provided by this patch:

* cppzmq is a very simple single-header binding
* zmqpp is a high-level binding, implemented in C++ as a separate library

When the new "C++ bindings" option for zeromq is selected, both of these C++ bindings are built and installed.

---

[...]

package/zeromq/Config.in line 6

Quoted 11 lines
package/zeromq/Config.in +2 -3
@@ -1,9 +1,8 @@
-comment "zeromq requires a toolchain with C++, LARGEFILE + WCHAR support"
-	depends on !(BR2_INSTALL_LIBSTDCPP &&  BR2_LARGEFILE && BR2_USE_WCHAR)
+comment "zeromq requires a toolchain with LARGEFILE and WCHAR support"
+	depends on !(BR2_LARGEFILE && BR2_USE_WCHAR)
 
 config BR2_PACKAGE_ZEROMQ
 	bool "zeromq"
-	depends on BR2_INSTALL_LIBSTDCPP

Although only the C binding is bundled with zeromq, the library itself seems to be implemented in C++, so this is not correct.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 zeromq: add C++ bindings

Hi Baruch,

Quoted 6 lines · Baruch Siach
Quoted 3 lines

config BR2_PACKAGE_ZEROMQ
bool "zeromq"
- depends on BR2_INSTALL_LIBSTDCPP

Although only the C binding is bundled with zeromq, the library itself seems to be implemented in C++, so this is not correct.

Ah, yes. Thanks for pointing that out. Will fix in the next iteration.

Simon

#3 lore raw

PATCH 1/1 zeromq: add C++ bindings

In reply to spdawson at gmail.com

Simon,

Quoted 13 lines · spdawson at gmail.com
package/Config.in +1 -0
index 9853b06..9519852 100644
@@ -495,6 +495,7 @@ source "package/mediastreamer/Config.in"
 endmenu
 
 menu "Networking"
+source "package/cppzmq/Config.in"
 source "package/glib-networking/Config.in"
 source "package/libcgi/Config.in"
 source "package/libcgicc/Config.in"

package/Config.in source "package/ortp/Config.in" · line 540

Quoted 5 lines
package/Config.in +1 -0
@@ -535,6 +536,7 @@ source "package/ortp/Config.in"
 source "package/slirp/Config.in"
 source "package/usbredir/Config.in"
 source "package/zeromq/Config.in"
+source "package/zmqpp/Config.in"
 endmenu

You should probably submit two separate patches for the two separate packages.

package/cppzmq/Config.in line 2

Quoted 9 lines
package/Config.in +0 -0
 menu "Other"
package/cppzmq/Config.in new file +2 -0
new file mode 100644
index 0000000..6ec168e
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_CPPZMQ
+	bool

Why don't you make this a normal package?

Quoted 1 line

+CPPZMQ_INSTALL_TARGET = NO

Not needed.

package/cppzmq/Config.in

Quoted 8 lines
package/cppzmq/Config.in new file +8 -0
+config BR2_PACKAGE_ZEROMQ_CPP
+	bool "C++ bindings"
+	depends on BR2_PACKAGE_ZEROMQ
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_CPPZMQ
+	select BR2_PACKAGE_ZMQPP
+	help
+	  C++ bindings.

I really believe cppzmq and zmqpp should be normal separate packages, that select the zeromq package. I don't see why we would "invert" the traditional logic we use for all packages.

package/zmqpp/Config.in line 2

Quoted 7 lines

new file mode 100644
index 0000000..954cf29

package/zmqpp/Config.in new file +2 -0
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_ZMQPP
+	bool

Same thing for zmqpp.

package/zmqpp/Config.in

Quoted 3 lines
package/zmqpp/Config.in new file +3 -0
+define ZMQPP_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(ZMQPP_MAKE_ENV) $(MAKE) $(ZMQPP_MAKE_OPT) -C $(@D)
+endef

I'm surprised, you're not passing CC, CXX and al. ? Not needed?

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 zeromq: add C++ bindings

Hi Thomas,

Quoted 3 lines · Thomas Petazzoni

I really believe cppzmq and zmqpp should be normal separate packages, that select the zeromq package. I don't see why we would "invert" the traditional logic we use for all packages.

Okay; I'll make them separate packages then.

Quoted 5 lines

package/zmqpp/zmqpp.mk line 18

Quoted 3 lines
package/zmqpp/zmqpp.mk new file +3 -0
+define ZMQPP_BUILD_CMDS
+     $(TARGET_MAKE_ENV) $(ZMQPP_MAKE_ENV) $(MAKE) $(ZMQPP_MAKE_OPT) -C $(@D)
+endef

I'm surprised, you're not passing CC, CXX and al. ? Not needed?

Hmm. You're quite right --- this doesn't work at all. Will fix in the next iteration.

Thanks for the feedback.

Simon.

#5 lore raw

PATCH 1/1 zeromq: add C++ bindings

In reply to spdawson at gmail.com

Hi, Simon!

2013/3/18 <[email protected]>

package/zeromq/Config.in line 2

Quoted 7 lines
package/zeromq/Config.in +0 -2
index b7dc8a6..db2384e 100644
@@ -1,9 +1,8 @@
-comment "zeromq requires a toolchain with C++, LARGEFILE + WCHAR support"
-       depends on !(BR2_INSTALL_LIBSTDCPP &&  BR2_LARGEFILE &&

BR2_USE_WCHAR)

package/zeromq/Config.in line 2

Quoted 2 lines
package/zeromq/Config.in +2 -0
+comment "zeromq requires a toolchain with LARGEFILE and WCHAR support"
+       depends on !(BR2_LARGEFILE && BR2_USE_WCHAR)

Doesn't zeromq 3.2.x also require BR2_INET_IPV6, like you posted earlier?

--
Best regards,
Alexander Lukichev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130319/d3ff5716/attachment.html>

#6 lore raw

PATCH 1/1 zeromq: add C++ bindings

Hi Alexander,

Quoted 4 lines · Alexander Lukichev

package/zeromq/Config.in line 2

Quoted 2 lines
package/zeromq/Config.in +2 -0
+comment "zeromq requires a toolchain with LARGEFILE and WCHAR support"
+       depends on !(BR2_LARGEFILE && BR2_USE_WCHAR)

Doesn't zeromq 3.2.x also require BR2_INET_IPV6, like you posted earlier?

Yes, you're quite right; but this patch has been superseded now.

Simon.