Source: pcp
Version: 3.9.4
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hello,

The attached patch hurd.patch adds support for GNU/Hurd. Additionally
the patch rules.patch adds autoconf to the .census target to make it
update configure from configure.in (that file should be called
configure.ac)

Thanks!

--- ad/ebian/rules	2014-05-15 03:36:44.000000000 +0200
+++ b/debian/rules	2014-06-16 09:34:15.000000000 +0200
@@ -130,6 +130,7 @@
 .census:
 	@echo "== dpkg-buildpackage: configure" 1>&2
 	$(checkdir)
+	autoconf
 	dh_autotools-dev_updateconfig
 	$(configure_tools) ./configure $(configure_paths)
 	touch .census
--- a/configure.in	2014-05-15 03:36:44.000000000 +0200
+++ b/configure.in	2014-06-10 09:16:28.000000000 +0200
@@ -171,6 +171,11 @@
     AC_DEFINE(IS_FREEBSD)
     test -f /etc/debian_version && target_distro=debian
     export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE"
+elif test $target_os = gnu
+then
+    AC_DEFINE(IS_GNU)
+    test -f /etc/debian_version && target_distro=debian
+    export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE"
 elif test $target_os = netbsdelf
 then
     target_os=netbsd
--- a/src/include/pcp_config.h.in	2014-04-15 11:03:53.000000000 +0200
+++ b/src/include/pcp/config.h.in	2014-06-10 13:21:38.000000000 +0200
@@ -400,7 +400,9 @@
 #endif
 #endif
 #ifndef MAXPATHLEN
-bozo! need to find where MAXPATHLEN is defined for this platform
+/* bozo! need to find where MAXPATHLEN is defined for this platform */
+#define PATH_MAX 4096
+#define MAXPATHLEN PATH_MAX
 #endif
 
 /*
@@ -428,7 +430,8 @@
 #endif
 #endif
 #ifndef MAXHOSTNAMELEN
-bozo! need to find where MAXHOSTNAMELEN is defined for this platform
+/* bozo! need to find where MAXHOSTNAMELEN is defined for this platform*/
+#define MAXHOSTNAMELEN 4096
 #endif
 
 #ifndef HAVE_FLOG10
@@ -505,6 +508,9 @@
 /* Determine if we are on a FreeBSD box */
 #undef IS_FREEBSD
 
+/* Determine if we are on a GNU box */
+#undef IS_GNU
+
 /* Determine if we are on a NetBSD box */
 #undef IS_NETBSD
 
--- a/src/include/builddefs.in	2014-05-15 03:36:44.000000000 +0200
+++ b/src/include/builddefs.in	2014-06-11 11:24:43.000000000 +0200
@@ -67,7 +67,7 @@
 TARGET_OS = @target_os@
 PCFLAGS = @PCFLAGS@
 PLDFLAGS = @PLDFLAGS@
-ifneq (, $(filter linux kfreebsd, $(TARGET_OS)))
+ifneq (, $(filter linux kfreebsd gnu, $(TARGET_OS)))
 DSOSUFFIX = so
 endif
 ifeq "$(TARGET_OS)" "darwin"
--- a/src/include/buildrules	2014-05-15 03:36:44.000000000 +0200
+++ b/src/include/buildrules	2014-06-10 08:52:17.000000000 +0200
@@ -40,7 +40,7 @@
 .SUFFIXES: .cxx
 
 ifdef LIBTARGET
-ifneq (, $(filter linux freebsd kfreebsd netbsd mingw, $(TARGET_OS)))
+ifneq (, $(filter linux freebsd kfreebsd netbsd mingw gnu, $(TARGET_OS)))
 _SHAREDOPTS	= -shared -Wl,-soname,$(LIBTARGET)
 endif
 ifeq ($(TARGET_OS), solaris)
--- a/src/pmdas/pmcd/src/GNUmakefile	2014-01-09 00:29:25.000000000 +0100
+++ b/src/pmdas/pmcd/src/GNUmakefile	2014-06-10 12:48:51.000000000 +0200
@@ -27,7 +27,7 @@
 LCFLAGS = -I$(TOPDIR)/src
 LCFLAGS += -I$(TOPDIR)/src/pmie/src
 
-ifneq (, $(filter linux kfreebsd, $(TARGET_OS)))
+ifneq (, $(filter linux kfreebsd gnu, $(TARGET_OS)))
 ABI = $(shell ./objstyle)
 LCFLAGS += -DSIM_ABI=\""$(ABI)"\"
 endif
--- a/src/pmdas/pmcd/src/pmcd.c	2014-01-09 00:29:25.000000000 +0100
+++ b/src/pmdas/pmcd/src/pmcd.c	2014-06-10 09:56:24.000000000 +0200
@@ -961,7 +961,7 @@
 static char *
 simabi()
 {
-#if defined(__linux__)
+#if defined(__linux__) || defined(IS_GNU)
 # if defined(__i386__)
     return "ia32";
 # elif defined(__ia64__) || defined(__ia64)
--- a/src/pmdas/shping/shping.c	2014-01-09 00:29:26.000000000 +0100
+++ b/src/pmdas/shping/shping.c	2014-06-10 10:55:44.000000000 +0200
@@ -210,11 +210,14 @@
     prctl(PR_TERMCHILD);          	/* SIGHUP when the parent dies */
 #elif defined (PR_SET_PDEATHSIG)
     prctl(PR_SET_PDEATHSIG, SIGTERM);
-#elif defined(IS_SOLARIS) || defined(IS_DARWIN) || defined(IS_MINGW) || defined(IS_AIX) || defined(IS_FREEBSD) || defined(IS_NETBSD)
+#elif defined(IS_SOLARIS) || defined(IS_DARWIN) || defined(IS_MINGW) || defined(IS_AIX) || defined(IS_FREEBSD) || defined(IS_GNU) || defined(IS_NETBSD)
     /* no signals here for child exit */
 #else
 !bozo: cant decide between PR_TERMCHILD and PR_SET_PDEATHSIG
 #endif
+#ifndef NOFILE
+#define NOFILE 7
+#endif
 
     signal(SIGALRM, onalarm);
 
--- a/src/pmie_pmie2col.sh	2014-05-15 03:36:44.000000000 +0200
+++ b/src/pmie/pmie2col.sh	2014-06-10 08:49:42.000000000 +0200
@@ -32,7 +32,7 @@
 #
 case "$PCP_PLATFORM"
 in
-    linux|mingw|kfreebsd)
+    linux|mingw|kfreebsd|gnu)
 	SED="sed -u"
 	;;
     freebsd|darwin)
--- a/src/pmwebapi/pmresapi.c	2014-01-09 00:29:28.000000000 +0100
+++ b/src/pmwebapi/pmresapi.c	2014-06-10 11:02:36.000000000 +0200
@@ -19,6 +19,7 @@
  */
 
 #include "pmwebapi.h"
+#include "config.h"
 
 
 /* ------------------------------------------------------------------------ */
--- a/src/pmieconf/GNUmakefile.rules	2014-01-09 00:29:26.000000000 +0100
+++ b/src/pmieconf/GNUmakefile.rules	2014-06-15 14:32:25.000000000 +0200
@@ -39,7 +39,7 @@
 	done
 
 rules:
-	@test ! -d ../rules/$(GROUP) && mkdir ../rules/$(GROUP); exit 0
+	@test ! -d ../rules/$(GROUP) && mkdir -p ../rules/$(GROUP); exit 0
 	@rm -f ../rules/$(GROUP)/*
 	@for f in IGNORE_DUMMY_RULE $(LOCAL_RULES); do \
 	    [ $$f = IGNORE_DUMMY_RULE ] && continue; \

Reply via email to