libzmq: Remove uClibc++ support
libzmq is used by fbzmq, which absolutely requires libstdcpp since it's a
C++14 project. There's no point in using two libc++.
Cleaned up Makefile for consistency between packages.
Added nanosleep patch for platforms that are missing usleep.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry-picked from ad11587c40
)
This commit is contained in:
parent
5ca357ef48
commit
8774958556
4 changed files with 70 additions and 38 deletions
|
@ -1,4 +1,4 @@
|
||||||
#
|
#
|
||||||
# Copyright (C) 2016 OpenWrt.org
|
# Copyright (C) 2016 OpenWrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
@ -11,25 +11,22 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=zeromq
|
PKG_NAME:=zeromq
|
||||||
PKG_VERSION:=4.1.7
|
PKG_VERSION:=4.1.7
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
|
|
||||||
PKG_LICENSE:=GPL-3.0+
|
|
||||||
PKG_LICENSE_FILES:=LICENCE.txt
|
|
||||||
|
|
||||||
PKG_CPE_ID:=cpe:/a:zeromq:libzmq
|
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://github.com/zeromq/zeromq4-1/releases/download/v$(PKG_VERSION)
|
PKG_SOURCE_URL:=https://github.com/zeromq/zeromq4-1/releases/download/v$(PKG_VERSION)
|
||||||
PKG_HASH:=31c383cfcd3be1dc8a66e448c403029e793687e70473b89c4cc0bd626e7da299
|
PKG_HASH:=31c383cfcd3be1dc8a66e448c403029e793687e70473b89c4cc0bd626e7da299
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
|
||||||
|
PKG_LICENSE:=GPL-3.0-or-later
|
||||||
|
PKG_LICENSE_FILES:=LICENCE.txt
|
||||||
|
PKG_CPE_ID:=cpe:/a:zeromq:libzmq
|
||||||
|
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
PKG_REMOVE_FILES:=autogen.sh acinclude.m4 aclocal.m4
|
||||||
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/uclibc++.mk
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/libzmq/default
|
define Package/libzmq/default
|
||||||
|
@ -37,7 +34,7 @@ define Package/libzmq/default
|
||||||
URL:=http://www.zeromq.org/
|
URL:=http://www.zeromq.org/
|
||||||
SECTION:=libs
|
SECTION:=libs
|
||||||
CATEGORY:=Libraries
|
CATEGORY:=Libraries
|
||||||
DEPENDS:=+libuuid +libpthread +librt $(CXX_DEPENDS)
|
DEPENDS:=+libuuid +libpthread +librt +libstdcpp
|
||||||
PROVIDES:=libzmq
|
PROVIDES:=libzmq
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -65,7 +62,10 @@ endef
|
||||||
# add extra configure flags here
|
# add extra configure flags here
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
--enable-shared
|
--enable-shared \
|
||||||
|
--with-pic \
|
||||||
|
--with-relaxed \
|
||||||
|
--without-documentation
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),curve)
|
ifeq ($(BUILD_VARIANT),curve)
|
||||||
CONFIGURE_ARGS+= --with-libsodium
|
CONFIGURE_ARGS+= --with-libsodium
|
||||||
|
@ -73,6 +73,8 @@ else
|
||||||
CONFIGURE_ARGS+= --without-libsodium
|
CONFIGURE_ARGS+= --without-libsodium
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
TARGET_CXXFLAGS += -Wno-error=cpp
|
||||||
|
|
||||||
define Build/InstallDev
|
define Build/InstallDev
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -150,8 +150,10 @@ case "${host_os}" in
|
|
||||||
*linux*)
|
|
||||||
# Define on Linux to enable all library features. Define if using a gnu compiler
|
|
||||||
if test "x$GXX" = "xyes"; then
|
|
||||||
- CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
|
|
||||||
+ CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS -Wno-long-long"
|
|
||||||
fi
|
|
||||||
+ libzmq_pedantic="no"
|
|
||||||
+ libzmq_werror="no"
|
|
||||||
AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
|
|
||||||
libzmq_on_linux="yes"
|
|
||||||
|
|
|
@ -12,16 +12,6 @@
|
||||||
|
|
||||||
metadata_t (const dict_t &dict);
|
metadata_t (const dict_t &dict);
|
||||||
virtual ~metadata_t ();
|
virtual ~metadata_t ();
|
||||||
--- a/src/socket_base.cpp
|
|
||||||
+++ b/src/socket_base.cpp
|
|
||||||
@@ -30,6 +30,7 @@
|
|
||||||
#include <new>
|
|
||||||
#include <string>
|
|
||||||
#include <algorithm>
|
|
||||||
+#include <ctype.h>
|
|
||||||
|
|
||||||
#include "platform.hpp"
|
|
||||||
|
|
||||||
--- a/src/stream_engine.cpp
|
--- a/src/stream_engine.cpp
|
||||||
+++ b/src/stream_engine.cpp
|
+++ b/src/stream_engine.cpp
|
||||||
@@ -208,7 +208,11 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
|
@@ -208,7 +208,11 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
|
||||||
|
@ -36,7 +26,7 @@
|
||||||
zmq_assert (metadata == NULL);
|
zmq_assert (metadata == NULL);
|
||||||
metadata = new (std::nothrow) metadata_t (properties);
|
metadata = new (std::nothrow) metadata_t (properties);
|
||||||
}
|
}
|
||||||
@@ -815,7 +815,11 @@ void zmq::stream_engine_t::mechanism_ready ()
|
@@ -824,7 +828,11 @@ void zmq::stream_engine_t::mechanism_ready ()
|
||||||
|
|
||||||
// If we have a peer_address, add it to metadata
|
// If we have a peer_address, add it to metadata
|
||||||
if (!peer_address.empty()) {
|
if (!peer_address.empty()) {
|
||||||
|
|
54
libs/zmq/patches/050-nanosleep.patch
Normal file
54
libs/zmq/patches/050-nanosleep.patch
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
--- a/src/signaler.cpp
|
||||||
|
+++ b/src/signaler.cpp
|
||||||
|
@@ -86,7 +86,8 @@ static int sleep_ms (unsigned int ms_)
|
||||||
|
usleep (ms_ * 1000);
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
- return usleep (ms_ * 1000);
|
||||||
|
+ const struct timespec req = {0, (long int)ms_ * 1000 * 1000};
|
||||||
|
+ return nanosleep (&req, NULL);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
--- a/src/tcp_address.cpp
|
||||||
|
+++ b/src/tcp_address.cpp
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
|
+#include <ctime>
|
||||||
|
|
||||||
|
#include "tcp_address.hpp"
|
||||||
|
#include "platform.hpp"
|
||||||
|
@@ -194,7 +195,8 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_
|
||||||
|
rc = getifaddrs (&ifa);
|
||||||
|
if (rc == 0 || (rc < 0 && errno != ECONNREFUSED))
|
||||||
|
break;
|
||||||
|
- usleep ((backoff_msec << i) * 1000);
|
||||||
|
+ const struct timespec req = {0, (backoff_msec << i) * 1000 * 1000};
|
||||||
|
+ nanosleep (&req, NULL);
|
||||||
|
}
|
||||||
|
errno_assert (rc == 0);
|
||||||
|
zmq_assert (ifa != NULL);
|
||||||
|
--- a/src/zmq.cpp
|
||||||
|
+++ b/src/zmq.cpp
|
||||||
|
@@ -692,7 +692,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||||
|
usleep (timeout_ * 1000);
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
- return usleep (timeout_ * 1000);
|
||||||
|
+ const struct timespec req = {0, timeout_ * 1000 * 1000};
|
||||||
|
+ return nanosleep (&req, NULL);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -852,7 +853,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||||
|
Sleep (timeout_ > 0 ? timeout_ : INFINITE);
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
- return usleep (timeout_ * 1000);
|
||||||
|
+ const struct timespec req = {0, timeout_ * 1000 * 1000};
|
||||||
|
+ return nanosleep (&req, NULL);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
zmq::clock_t clock;
|
Loading…
Reference in a new issue