Bug#765365: corosync: FTBFS on hurd-i386
Source: corosync
Version: 1.4.6-1.1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd
Hello,
Currently corosync FTBFS for GNU/Hurd due to missing OS support. The
attached patch adds support for GNU/Hurd by adding a COROSYNC_GNU entry
in configure.ac, add COROSYNC_GNU entries in exec/totemip.c and use
_POSIX_PIPE_BUF as a replacement to PIPE_BUF, since that constant is not
defined on Hurd.
Thanks!
Index: corosync-1.4.6/configure.ac
===================================================================
--- corosync-1.4.6.orig/configure.ac
+++ corosync-1.4.6/configure.ac
@@ -342,6 +342,17 @@ case "$host_os" in
DARWIN_OPTS=""
SOLARIS_OPTS=" "
;;
+ *gnu*)
+ AC_DEFINE_UNQUOTED([COROSYNC_GNU], [1],
+ [Compiling for GNU/Hurd platform])
+ AC_DEFINE_UNQUOTED([PATH_MAX], [4096],
+ [Number of chars in a path name including nul])
+ OS_CFLAGS=""
+ OS_CPPFLAGS="-D_GNU_SOURCE"
+ OS_LDFLAGS=""
+ OS_DYFLAGS="-rdynamic"
+ DARWIN_OPTS=""
+ ;;
*)
AC_MSG_ERROR([Unsupported OS? hmmmm])
;;
Index: corosync-1.4.6/exec/totemip.c
===================================================================
--- corosync-1.4.6.orig/exec/totemip.c
+++ corosync-1.4.6/exec/totemip.c
@@ -65,11 +65,15 @@
#include <unistd.h>
#if defined(COROSYNC_LINUX)
-#include <net/if.h>
#include <asm/types.h>
#include <linux/rtnetlink.h>
#endif
+#if defined(COROSYNC_GNU)
+#include <net/if.h>
+#include <ifaddrs.h>
+#endif
+
#include <corosync/totem/totemip.h>
#include <corosync/swab.h>
@@ -425,7 +429,7 @@ int totemip_iface_check(struct totem_ip_
}
#endif
-#if defined(COROSYNC_BSD) || defined(COROSYNC_DARWIN)
+#if defined(COROSYNC_BSD) || defined(COROSYNC_DARWIN) || defined(COROSYNC_GNU)
int totemip_iface_check(struct totem_ip_address *bindnet,
struct totem_ip_address *boundto,
int *interface_up,
Index: corosync-1.4.6/services/cfg.c
===================================================================
--- corosync-1.4.6.orig/services/cfg.c
+++ corosync-1.4.6/services/cfg.c
@@ -1067,6 +1067,9 @@ exit_fn:
LEAVE();
}
+#ifndef PIPE_BUF
+#define PIPE_BUF _POSIX_PIPE_BUF
+#endif
static void message_handler_req_lib_cfg_get_node_addrs (void *conn,
const void *msg)
{
Reply to: