On Tue, 2016-01-19 at 14:14 +0000, László Böszörményi (GCS) wrote:
> On Tue, Jan 19, 2016 at 2:13 PM, Svante Signell
> <[email protected]> wrote:
> > On Tue, 2016-01-19 at 13:05 +0100, Svante Signell wrote:
> > > Additionally, until upstream makes a new release, do you think it is
> > > possible
> > > to add the patch to the Debian package so that packages reverse-depending
> > > on
> > > it can be built?
> Sure, I'll use it for the next upload.
>
> > Hello again, attached is an updated patch based on master at github. With
> > these
> > modifications also version 4.1.2 from experimental almost builds. Some
> > further
> > patches are needed for a successful build and the testsuite to pass.
> So should I wait for further fixes (those will happen in some hours /
> days) or submit this as-is to upstream?
Hello,
Attached is a patch, hurd-support_4.1.2.patch, making the Debian version 4.1.2
to build properly. Additionally, the patch hurd-support_update.patch is made
against the git master version. I don't know yet if it builds since upstream
does not have a debian/ directory, and it is not yet packaged for Debian.
Thanks!
Index: zeromq3-4.1.2/configure.ac
===================================================================
--- zeromq3-4.1.2.orig/configure.ac
+++ zeromq3-4.1.2/configure.ac
@@ -136,6 +136,7 @@ libzmq_dso_visibility="yes"
libzmq_on_mingw32="no"
libzmq_on_android="no"
libzmq_on_linux="no"
+libzmq_on_gnu="no"
# Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
@@ -273,6 +274,15 @@ case "${host_os}" in
AC_MSG_ERROR([Building static libraries is not supported under Cygwin])
fi
;;
+ gnu*)
+ # Define on GNU/Hurd to enable all library features. Define if using a gnu compiler
+ if test "x$GXX" = "xyes"; then
+ CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
+ fi
+ AC_DEFINE(ZMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
+ libzmq_on_gnu="yes"
+ AC_CHECK_LIB(rt, sem_init)
+ ;;
*)
AC_MSG_ERROR([unsupported system: ${host_os}.])
;;
@@ -474,6 +484,7 @@ AM_CONDITIONAL(BUILD_TIPC, test "x$libzm
AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$libzmq_on_android" = "xyes")
AM_CONDITIONAL(ON_LINUX, test "x$libzmq_on_linux" = "xyes")
+AM_CONDITIONAL(ON_GNU, test "x$libzmq_on_gnu" = "xyes")
# Checks for library functions.
AC_TYPE_SIGNAL
Index: zeromq3-4.1.2/src/poller.hpp
===================================================================
--- zeromq3-4.1.2.orig/src/poller.hpp
+++ zeromq3-4.1.2/src/poller.hpp
@@ -48,6 +48,9 @@
#include "poll.hpp"
#elif defined ZMQ_USE_SELECT
#include "select.hpp"
+#elif defined ZMQ_HAVE_GNU
+#define ZMQ_USE_POLL
+#include "poll.hpp"
#else
#error None of the ZMQ_USE_* macros defined
#endif
Index: zeromq3-4.1.2/src/ipc_connecter.cpp
===================================================================
--- zeromq3-4.1.2.orig/src/ipc_connecter.cpp
+++ zeromq3-4.1.2/src/ipc_connecter.cpp
@@ -252,8 +252,11 @@ zmq::fd_t zmq::ipc_connecter_t::connect
socklen_t len = sizeof (err);
#endif
int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char*) &err, &len);
- if (rc == -1)
+ if (rc == -1) {
+ if (errno == ENOPROTOOPT)
+ errno = 0;
err = errno;
+ }
if (err != 0) {
// Assert if the error was caused by 0MQ bug.
Index: zeromq3-4.1.2/src/tcp_address.cpp
===================================================================
--- zeromq3-4.1.2.orig/src/tcp_address.cpp
+++ zeromq3-4.1.2/src/tcp_address.cpp
@@ -156,7 +156,8 @@ int zmq::tcp_address_t::resolve_nic_name
#elif ((defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_OPENBSD ||\
- defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD)\
+ defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD ||\
+ defined ZMQ_HAVE_GNU)\
&& defined ZMQ_HAVE_IFADDRS)
#include <ifaddrs.h>
Index: zeromq3-4.1.2/Makefile.am
===================================================================
--- zeromq3-4.1.2.orig/Makefile.am
+++ zeromq3-4.1.2/Makefile.am
@@ -588,6 +588,12 @@ if !ON_LINUX
XFAIL_TESTS += test_abstract_ipc
endif
+if ON_GNU
+XFAIL_TESTS += \
+ test_ipc_wildcard \
+ test_term_endpoint
+endif
+
EXTRA_DIST = \
CMakeLists.txt \
autogen.sh \
Index: zeromq3-4.1.2/src/thread.cpp
===================================================================
--- zeromq3-4.1.2.orig/src/thread.cpp
+++ zeromq3-4.1.2/src/thread.cpp
@@ -114,7 +114,7 @@ void zmq::thread_t::stop ()
void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_)
{
-#if !defined ZMQ_HAVE_ZOS
+#if !defined ZMQ_HAVE_ZOS && !defined ZMQ_HAVE_GNU
int policy = 0;
struct sched_param param;
diff --git a/Makefile.am b/Makefile.am
index 825c3c3..02a96a5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -702,6 +702,11 @@ if !ON_LINUX
XFAIL_TESTS += tests/test_abstract_ipc
endif
+if ON_GNU
+XFAIL_TESTS += test_ipc_wildcard \
+ test_term_endpoint
+endif
+
EXTRA_DIST = \
CMakeLists.txt \
autogen.sh \
diff --git a/configure.ac b/configure.ac
index 589f90d..cbc4017 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,20 +146,6 @@ CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
# For host type checks
AC_CANONICAL_HOST
-#For a working getsockopt() optname=SO_ERROR
-dnl AC_MSG_CHECKING([for getsockopt optname SO_ERROR)])
-dnl AC_TRY_COMPILE([
-dnl #include <sys/types.h>
-dnl #include <sys/socket.h>
-dnl ], [socklen_t t;], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)
-dnl if test "x$ac_cv_type_socklen_t" = "xyes"; then
-dnl AC_MSG_RESULT([yes])
-dnl AC_DEFINE(HAVE_SOCKLEN_T,1,
-dnl [Define if socklen_t is available])
-dnl else
-dnl AC_MSG_RESULT([no])
-dnl fi
-
# OS-specific tests
case "${host_os}" in
*linux*)
@@ -304,8 +290,6 @@ case "${host_os}" in
AC_DEFINE(ZMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
libzmq_on_gnu="yes"
AC_CHECK_LIB(rt, sem_init)
-dnl AC_CHECK_LIB(uuid, uuid_generate, ,
-dnl [AC_MSG_ERROR([cannot link with -luuid, install uuid-dev.])])
;;
*)
AC_MSG_ERROR([unsupported system: ${host_os}.])
diff --git a/src/poller.hpp b/src/poller.hpp
index f3d8d67..a87d509 100644
--- a/src/poller.hpp
+++ b/src/poller.hpp
@@ -49,12 +49,8 @@
#elif defined ZMQ_USE_SELECT
#include "select.hpp"
#elif defined ZMQ_HAVE_GNU
-#define ZMQ_USE_SELECT
-#include "select.hpp"
-#if 0
#define ZMQ_USE_POLL
#include "poll.hpp"
-#endif
#else
#error None of the ZMQ_USE_* macros defined
#endif
diff --git a/src/thread.cpp b/src/thread.cpp
index d013737..1386b71 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -114,7 +114,7 @@ void zmq::thread_t::stop ()
void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_)
{
-#if !defined ZMQ_HAVE_ZOS && !defined ZMQ_HAVE_HPUX
+#if !defined ZMQ_HAVE_ZOS && !defined ZMQ_HAVE_HPUX && !defined ZMQ_HAVE_GNU
int policy = 0;
struct sched_param param;