Bug#681645: ptlib: FTBFS on Debian GNU/Hurd [patch attached]

Barry deFreese bdefreese at debian.org
Sun Jul 15 00:10:55 UTC 2012


Package: ptlib
Version: 2.10.4~dfsg-1
Severity: important
User: debian-hurd at lists.debian.org
Usertags: hurd
Tags: patch

Hi,

Currently ptlib fails to build on Debian GNU/Hurd.

Attached is a patch for building on Hurd.  It also requires a fix to remove the --enable-oss flag
when building on Hurd as we don't have sound support.

Thank you,

Barry deFreese

-------------- next part --------------
Index: ptlib-2.10.4~dfsg/configure
===================================================================
--- ptlib-2.10.4~dfsg.orig/configure	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/configure	2012-07-14 21:44:26.000000000 +0000
@@ -4358,6 +4358,24 @@
 
                    ;;
 
+  gnu*)            OSTYPE=gnu ;
+                   OSRELEASE="\"`uname -r`\"";
+		   OS_TAG="P_GNU" ;
+                   need_pragma=yes ;
+
+$as_echo "#define P_PTHREADS 1" >>confdefs.h
+
+
+ac_fn_cxx_check_func "$LINENO" "swab" "ac_cv_func_swab"
+if test "x$ac_cv_func_swab" = x""yes; then :
+
+$as_echo "#define USE_SYSTEM_SWAB /**/" >>confdefs.h
+
+fi
+
+                   ;;
+
+
   freebsd*|kfreebsd*)       OSTYPE=FreeBSD ;
 		   OS_TAG="P_FREEBSD" ;
                    if test "x$OSRELEASE" = "x"; then
Index: ptlib-2.10.4~dfsg/include/ptbuildopts.h.in
===================================================================
--- ptlib-2.10.4~dfsg.orig/include/ptbuildopts.h.in	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/include/ptbuildopts.h.in	2012-07-14 21:44:26.000000000 +0000
@@ -50,6 +50,7 @@
 #undef    P_MACOSX
 #undef    P_CYGWIN
 #undef    P_MINGW
+#undef    P_GNU
 #undef    P_UNKNOWN_OS 
 
 #ifndef _WIN32_WCE
Index: ptlib-2.10.4~dfsg/include/ptlib/Nucleus++/ptlib/pmachdep.h
===================================================================
--- ptlib-2.10.4~dfsg.orig/include/ptlib/Nucleus++/ptlib/pmachdep.h	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/include/ptlib/Nucleus++/ptlib/pmachdep.h	2012-07-14 21:44:26.000000000 +0000
@@ -62,6 +62,23 @@
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
+#if defined(P_GNU)
+
+#include <paths.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+#include <sys/fcntl.h>
+#include <sys/termios.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <dlfcn.h>
+
+#define HAS_IFREQ
+#define PSETPGRP()  setpgrp()
+
+///////////////////////////////////////////////////////////////////////////////
 #elif defined(P_FREEBSD)
 
 #if defined(P_PTHREADS)
Index: ptlib-2.10.4~dfsg/include/ptlib/Nucleus++/ptlib/ptlib.inl
===================================================================
--- ptlib-2.10.4~dfsg.orig/include/ptlib/Nucleus++/ptlib/ptlib.inl	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/include/ptlib/Nucleus++/ptlib/ptlib.inl	2012-07-14 21:44:26.000000000 +0000
@@ -29,7 +29,7 @@
  * $Id: ptlib.inl 25251 2011-03-04 11:12:05Z rjongbloed $
  */
 
-#if defined(P_LINUX)
+#if defined(P_LINUX) || defined(P_GNU)
 #if (__GNUC_MINOR__ < 7)
 #include <localeinfo.h>
 #else
Index: ptlib-2.10.4~dfsg/include/ptlib/unix/ptlib/pmachdep.h
===================================================================
--- ptlib-2.10.4~dfsg.orig/include/ptlib/unix/ptlib/pmachdep.h	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/include/ptlib/unix/ptlib/pmachdep.h	2012-07-14 21:44:26.000000000 +0000
@@ -61,6 +61,23 @@
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
+#elif defined(P_GNU)
+
+#include <paths.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+#include <sys/fcntl.h>
+#include <sys/termios.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <dlfcn.h>
+
+#define HAS_IFREQ
+
+///////////////////////////////////////////////////////////////////////////////
 #elif defined(P_FREEBSD)
 
 #if defined(P_PTHREADS)
Index: ptlib-2.10.4~dfsg/include/ptlib/unix/ptlib/ptlib.inl
===================================================================
--- ptlib-2.10.4~dfsg.orig/include/ptlib/unix/ptlib/ptlib.inl	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/include/ptlib/unix/ptlib/ptlib.inl	2012-07-14 21:44:26.000000000 +0000
@@ -29,7 +29,7 @@
  * $Id: ptlib.inl 19008 2007-11-29 09:17:41Z rjongbloed $
  */
 
-#if defined(P_LINUX)
+#if defined(P_LINUX) || defined(P_GNU)
 #if (__GNUC_MINOR__ < 7 && __GNUC__ <= 2)
 #include <localeinfo.h>
 #else
Index: ptlib-2.10.4~dfsg/include/ptlib/object.h
===================================================================
--- ptlib-2.10.4~dfsg.orig/include/ptlib/object.h	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/include/ptlib/object.h	2012-07-14 21:44:26.000000000 +0000
@@ -755,6 +755,9 @@
 #ifdef P_LINUX
                               + sizeof(pthread_t)
 #endif
+#ifdef P_GNU
+                              + sizeof(pthread_t)
+#endif
                               )%8
       };
 
@@ -769,6 +772,9 @@
 #ifdef P_LINUX
       pthread_t    thread;
 #endif
+#ifdef P_GNU
+      pthread_t    thread;
+#endif
       char         guard[NumGuardBytes];
 
       static char GuardBytes[NumGuardBytes];
Index: ptlib-2.10.4~dfsg/make/unix.mak
===================================================================
--- ptlib-2.10.4~dfsg.orig/make/unix.mak	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/make/unix.mak	2012-07-14 21:44:26.000000000 +0000
@@ -57,7 +57,7 @@
 .PHONY: all $(STANDARD_TARGETS)
 
 
-ifeq (,$(findstring $(OSTYPE),linux FreeBSD OpenBSD NetBSD solaris beos Darwin Carbon AIX Nucleus VxWorks rtems QNX cygwin mingw))
+ifeq (,$(findstring $(OSTYPE),linux gnu FreeBSD OpenBSD NetBSD solaris beos Darwin Carbon AIX Nucleus VxWorks rtems QNX cygwin mingw))
 
 default_target :
 	@echo
@@ -70,7 +70,7 @@
 	@echo
 	@echo "         Currently supported OSTYPE names are:"
 	@echo "              linux Linux linux-gnu mklinux"
-	@echo "              solaris Solaris SunOS"
+	@echo "              gnu solaris Solaris SunOS"
 	@echo "              FreeBSD OpenBSD NetBSD beos Darwin Carbon"
 	@echo "              VxWorks rtems mingw"
 	@echo
@@ -165,6 +165,41 @@
 
 endif # linux
 
+####################################################
+
+ifeq ($(OSTYPE),gnu)
+
+ifeq ($(MACHTYPE),x86)
+ifdef CPUTYPE
+ifeq ($(CPUTYPE),crusoe)
+STDCCFLAGS	+= -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=0 
+STDCCFLAGS      += -malign-jumps=0 -malign-loops=0
+else
+STDCCFLAGS	+= -mcpu=$(CPUTYPE)
+endif
+endif
+endif
+
+ifeq ($(MACHTYPE),ia64)
+STDCCFLAGS     += -DP_64BIT
+endif
+
+ifeq ($(MACHTYPE),x86_64)
+STDCCFLAGS     += -DP_64BIT
+LDLIBS		+= -lresolv
+endif
+
+ifeq ($(P_SHAREDLIB),1)
+ifndef PROG
+STDCCFLAGS	+= -fPIC -DPIC
+endif # PROG
+endif # P_SHAREDLIB
+
+
+STATIC_LIBS	:= libstdc++.a libg++.a libm.a libc.a
+SYSLIBDIR	:= $(shell $(PTLIBDIR)/make/ptlib-config --libdir)
+
+endif # gnu
 
 ####################################################
 
Index: ptlib-2.10.4~dfsg/src/ptlib/unix/serchan.cxx
===================================================================
--- ptlib-2.10.4~dfsg.orig/src/ptlib/unix/serchan.cxx	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/src/ptlib/unix/serchan.cxx	2012-07-14 21:44:26.000000000 +0000
@@ -43,6 +43,10 @@
 #define  TCSETATTR(f,t)  tcsetattr(f,TCSANOW,t)
 #define  TCGETATTR(f,t)  tcgetattr(f,t)
 
+#elif defined(P_GNU)
+#define  TCSETATTR(f,t)  tcsetattr(f,TCSANOW,t)
+#define  TCGETATTR(f,t)  tcgetattr(f,t)
+
 #elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined (P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_RTEMS)
 #include <sys/ttycom.h>
 #define TCGETA TIOCGETA
@@ -380,6 +384,9 @@
   // The BSD way
   Termio.c_ispeed = baud; 
   Termio.c_ospeed = baud;
+#elif defined(P_GNU)
+  Termio.__ispeed = baud; 
+  Termio.__ospeed = baud;
 #else
   // The Linux way
   Termio.c_cflag &= ~CBAUD;
Index: ptlib-2.10.4~dfsg/src/ptlib/unix/osutil.cxx
===================================================================
--- ptlib-2.10.4~dfsg.orig/src/ptlib/unix/osutil.cxx	2012-07-14 21:43:50.000000000 +0000
+++ ptlib-2.10.4~dfsg/src/ptlib/unix/osutil.cxx	2012-07-14 22:19:47.000000000 +0000
@@ -48,7 +48,7 @@
 #pragma implementation "object.h"
 #pragma implementation "contain.h"
 
-#if defined(P_LINUX)
+#if defined(P_LINUX) || defined(P_GNU)
 #ifndef _REENTRANT
 #define _REENTRANT
 #endif
@@ -69,7 +69,7 @@
 #endif
 #include <ctype.h>
 
-#if defined(P_LINUX)
+#if defined(P_LINUX) || defined(P_GNU)
 
 #include <mntent.h>
 #include <sys/vfs.h>
@@ -507,7 +507,7 @@
   if (stat(operator+("."), &status) != -1) {
     dev_t my_dev = status.st_dev;
 
-#if defined(P_LINUX) || defined(P_IRIX)
+#if defined(P_LINUX) || defined(P_IRIX) || defined(P_GNU)
 
     FILE * fp = setmntent(MOUNTED, "r");
     if (fp != NULL) {
@@ -575,7 +575,7 @@
 
 PBoolean PDirectory::GetVolumeSpace(PInt64 & total, PInt64 & free, DWORD & clusterSize) const
 {
-#if defined(P_LINUX) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS)
+#if defined(P_LINUX) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_GNU)
 
   struct statfs fs;
 
@@ -1262,10 +1262,10 @@
 
 PString PTime::GetTimeSeparator()
 {
-#if defined(P_LINUX) || defined(P_HPUX9) || defined(P_SOLARIS) || defined(P_IRIX)
+#if defined(P_LINUX) || defined(P_HPUX9) || defined(P_SOLARIS) || defined(P_IRIX) || defined(P_GNU)
 #  if defined(P_USE_LANGINFO)
      char * p = nl_langinfo(T_FMT);
-#  elif defined(P_LINUX)
+#  elif defined(P_LINUX) || defined(P_GNU)
      char * p = _time_info->time; 
 #  endif
   char buffer[2];
@@ -1295,7 +1295,7 @@
 
 PTime::DateOrder PTime::GetDateOrder()
 {
-#if defined(P_USE_LANGINFO) || defined(P_LINUX)
+#if defined(P_USE_LANGINFO) || defined(P_LINUX) || defined(P_GNU)
 #  if defined(P_USE_LANGINFO)
      char * p = nl_langinfo(D_FMT);
 #  else
@@ -1339,7 +1339,7 @@
 
 PString PTime::GetDateSeparator()
 {
-#if defined(P_USE_LANGINFO) || defined(P_LINUX)
+#if defined(P_USE_LANGINFO) || defined(P_LINUX) || defined(P_GNU)
 #  if defined(P_USE_LANGINFO)
      char * p = nl_langinfo(D_FMT);
 #  else
@@ -1378,7 +1378,7 @@
                    nl_langinfo((nl_item)(DAY_1+(int)day))
                 );
 
-#elif defined(P_LINUX)
+#elif defined(P_LINUX) || defined(P_GNU)
   return (type == Abbreviated) ? PString(_time_info->abbrev_wkday[(int)day]) :
                        PString(_time_info->full_wkday[(int)day]);
 
@@ -1411,7 +1411,7 @@
      (type == Abbreviated) ? nl_langinfo((nl_item)(ABMON_1+(int)month-1)) :
                    nl_langinfo((nl_item)(MON_1+(int)month-1))
                 );
-#elif defined(P_LINUX)
+#elif defined(P_LINUX) || defined(P_GNU)
   return (type == Abbreviated) ? PString(_time_info->abbrev_month[(int)month-1]) :
                        PString(_time_info->full_month[(int)month-1]);
 #elif defined(P_USE_STRFTIME)
@@ -1446,7 +1446,7 @@
 
 int PTime::GetTimeZone(PTime::TimeZoneType type) 
 {
-#if defined(P_LINUX) || defined(P_SOLARIS) || defined (P_AIX) || defined(P_IRIX)
+#if defined(P_LINUX) || defined(P_SOLARIS) || defined (P_AIX) || defined(P_IRIX) || defined(P_GNU)
   long tz = -::timezone/60;
   if (type == StandardTime)
     return tz;
@@ -1478,7 +1478,7 @@
 
 PString PTime::GetTimeZoneString(PTime::TimeZoneType type) 
 {
-#if defined(P_LINUX) || defined(P_SUN4) || defined(P_SOLARIS) || defined (P_AIX) || defined(P_IRIX) || defined(P_QNX)
+#if defined(P_LINUX) || defined(P_SUN4) || defined(P_SOLARIS) || defined (P_AIX) || defined(P_IRIX) || defined(P_QNX) || defined(P_GNU)
   const char * str = (type == StandardTime) ? ::tzname[0] : ::tzname[1]; 
   if (str != NULL)
     return str;
Index: ptlib-2.10.4~dfsg/src/ptlib/unix/tlib.cxx
===================================================================
--- ptlib-2.10.4~dfsg.orig/src/ptlib/unix/tlib.cxx	2012-02-21 22:56:58.000000000 +0000
+++ ptlib-2.10.4~dfsg/src/ptlib/unix/tlib.cxx	2012-07-14 22:40:37.000000000 +0000
@@ -64,13 +64,13 @@
 #include <sys/wait.h>
 #include <errno.h>
 
-#if defined(P_LINUX)
+#if defined(P_LINUX) || defined(P_GNU)
 #include <sys/cdefs.h>
 #include <sys/types.h>
 #include <sys/mman.h>
 #endif
 
-#if defined(P_LINUX) || defined(P_SUN4) || defined(P_SOLARIS) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined (P_AIX) || defined(P_BEOS) || defined(P_IRIX) || defined(P_QNX)
+#if defined(P_LINUX) || defined(P_SUN4) || defined(P_SOLARIS) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined (P_AIX) || defined(P_BEOS) || defined(P_IRIX) || defined(P_QNX) || defined(P_GNU)
 #include <sys/utsname.h>
 #define  HAS_UNAME
 #elif defined(P_RTEMS)
@@ -217,7 +217,7 @@
 #if defined(P_PTHREADS) && !defined(P_THREAD_SAFE_CLIB)
   struct passwd pwd;
   char buffer[1024];
-#if defined (P_LINUX) || defined(P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS)
+#if defined (P_LINUX) || defined(P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS) || defined(P_GNU)
   ::getpwuid_r(geteuid(), &pwd,
                buffer, 1024,
                &pw);
@@ -268,7 +268,7 @@
   struct passwd pwd;
   char buffer[1024];
   struct passwd * pw = NULL;
-#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS)
+#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS) || defined(P_GNU)
   ::getpwuid_r(geteuid(), &pwd, buffer, 1024, &pw);
 #else
   pw = ::getpwuid_r(geteuid(), &pwd, buffer, 1024);
@@ -309,7 +309,7 @@
     struct passwd pwd;
     char buffer[1024];
     struct passwd * pw = NULL;
-#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS)
+#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS) || defined(P_GNU)
     ::getpwnam_r(username, &pwd, buffer, 1024, &pw);
 #else
     pw = ::getpwnam_r(username, &pwd, buffer, 1024);
@@ -356,7 +356,7 @@
   struct group grp;
   char buffer[1024];
   struct group * gr = NULL;
-#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS)
+#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS) || defined(P_GNU)
   ::getgrgid_r(getegid(), &grp, buffer, 1024, &gr);
 #else
   gr = ::getgrgid_r(getegid(), &grp, buffer, 1024);
@@ -397,7 +397,7 @@
     struct group grp;
     char buffer[1024];
     struct group * gr = NULL;
-#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS)
+#if defined (P_LINUX) || defined (P_AIX) || defined(P_IRIX) || (__GNUC__>=3 && defined(P_SOLARIS)) || defined(P_RTEMS) || defined(P_GNU)
     ::getgrnam_r(groupname, &grp, buffer, 1024, &gr);
 #else
     gr = ::getgrnam_r(groupname, &grp, buffer, 1024);
Index: ptlib-2.10.4~dfsg/src/ptlib/common/sockets.cxx
===================================================================
--- ptlib-2.10.4~dfsg.orig/src/ptlib/common/sockets.cxx	2012-02-21 22:57:00.000000000 +0000
+++ ptlib-2.10.4~dfsg/src/ptlib/common/sockets.cxx	2012-07-14 23:00:21.000000000 +0000
@@ -582,7 +582,7 @@
     host_info = Vx_gethostbyname((char *)name, &hostEnt);
     localErrNo = h_errno;
 
-#elif defined P_LINUX
+#elif defined P_LINUX || defined(P_GNU)
 
     char buffer[REENTRANT_BUFFER_LEN];
     struct hostent hostEnt;
@@ -711,7 +711,7 @@
     struct hostent hostEnt;
     host_info = Vx_gethostbyaddr(addr.GetPointer(), &hostEnt);
 
-#elif defined P_LINUX
+#elif defined P_LINUX || defined(P_GNU)
 
     char buffer[REENTRANT_BUFFER_LEN];
     struct hostent hostEnt;


More information about the Pkg-voip-maintainers mailing list