[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#670794: gnunet: FTBFS on hurd-i386.



Package: gnunet
Severity: important
Tags: upstream patch

Dear Maintainer,

Currently, gnunet fails to build from source on hurd-i386. The attached patches
should fix this issue.

* The first patch adds gnu* to the list of supported operating systems in
  configure.ac. It is not perfect, since I could not try it with a running X
  server and Qt. Still, this should be a good start.

* The second patch checks for the presence of the net/if.h header, so that the
  HAVE_NET_IF_H macro is defined to 1 when it is available.

* The third and fourth patches include some missing headers.

* The fifth patch fixes a simple compilation error.

* The sixth patch fixes calls to ioctl(fd, TCGETS, ...) and ioctl(fd, TCSETS,
  ...) as described in http://www.gnu.org/software/hurd/hurd/porting/guidelines.html

* The seventh patch fixes a PATH_MAX issue. Since there is no such limit in the
  Hurd, I just assumed that GNUNET_min(x, PATH_MAX - y) could be just "x" on
  Hurd.

WBR,
Cyril Roelandt.


-- System Information:
Debian Release: wheezy/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)

Kernel: GNU-Mach 1.3.99/Hurd-0.3
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
--- gnunet.orig/configure.ac	2012-04-29 00:55:50.000000000 +0000
+++ gnunet/configure.ac	2012-04-29 01:05:06.000000000 +0000
@@ -170,6 +170,10 @@
      QTINC="-I$QTDIR/include -I$QTDIR/include/QtCore -I$QTDIR/include/QtGui -I$QTDIR/include/QtOpenGL -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -frtti -fexceptions"
      QTBIN="$QTDIR/bin"
      ;;
+gnu*)
+     AC_DEFINE_UNQUOTED(GNU,1,[This is a GNU system])
+     build_target="gnu"
+     ;;
 *)
      AC_MSG_RESULT(Unrecognised OS $host_os)
      AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
@@ -186,6 +190,7 @@
 AM_CONDITIONAL(XFREEBSD, test "$build_target" = "freebsd")
 AM_CONDITIONAL(OPENBSD, test "$build_target" = "openbsd")
 AM_CONDITIONAL(LINUX, test "$build_target" = "linux")
+AM_CONDITIONAL(GNU, test "$build_target" = "gnu")
 AC_MSG_RESULT([$build_target])
 AC_SUBST(build_target)
 AM_CONDITIONAL([am__fastdepOBJC], false)
--- gnunet.orig/configure.ac	2012-04-29 01:18:39.000000000 +0000
+++ gnunet/configure.ac	2012-04-29 01:12:40.000000000 +0000
@@ -288,7 +288,7 @@
 AC_CHECK_HEADERS([fcntl.h math.h errno.h ctype.h limits.h stdio.h stdlib.h string.h unistd.h stdarg.h signal.h locale.h sys/stat.h sys/types.h pthread.h],,AC_MSG_ERROR([Compiling GNUnet requires standard UNIX headers files]))
 
 # Checks for headers that are only required on some systems or opional (and where we do NOT abort if they are not there)
-AC_CHECK_HEADERS([langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h iconv.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h])
+AC_CHECK_HEADERS([langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h iconv.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h net/if.h])
 
 # Check for GMP header (and abort if not present)
 AC_CHECK_HEADERS([gmp.h],,AC_MSG_ERROR([Compiling GNUnet requires gmp.h (from the GNU MP library, libgmp)]))
--- gnunet.orig/src/util/disk/storage.c	2012-04-29 00:56:16.000000000 +0000
+++ gnunet/src/util/disk/storage.c	2012-04-28 02:16:52.000000000 +0000
@@ -30,7 +30,7 @@
 
 
 
-#if LINUX || CYGWIN
+#if LINUX || CYGWIN || GNU
 #include <sys/vfs.h>
 #else
 #ifdef SOMEBSD
--- gnunet.orig/src/util/network/ip.c	2012-04-29 00:56:16.000000000 +0000
+++ gnunet/src/util/network/ip.c	2012-04-28 02:18:29.000000000 +0000
@@ -41,6 +41,10 @@
 #include "platform.h"
 #include "gnunet_util_network.h"
 
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
 /* maximum length of hostname */
 #define MAX_HOSTNAME 1024
 
--- gnunet.orig/src/util/os/osconfig.c	2012-04-29 00:56:17.000000000 +0000
+++ gnunet/src/util/os/osconfig.c	2012-04-28 02:19:30.000000000 +0000
@@ -30,6 +30,9 @@
 #include "platform.h"
 #include "gnunet_util_os.h"
 #include "gnunet_util_string.h"
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
 
 /**
  * @brief Enumerate all network interfaces
--- gnunet.orig/src/util/threads/pthread.c	2012-04-29 00:56:16.000000000 +0000
+++ gnunet/src/util/threads/pthread.c	2012-04-28 02:21:26.000000000 +0000
@@ -218,7 +218,7 @@
 void
 GNUNET_thread_sleep (unsigned long long delay)
 {
-#if LINUX || SOLARIS || SOMEBSD || OSX
+#if LINUX || SOLARIS || SOMEBSD || OSX || GNU
   struct timespec req;
   struct timespec rem;
 #elif WINDOWS
@@ -228,7 +228,7 @@
 #endif
 
   /* actual sleep */
-#if LINUX || SOLARIS || SOMEBSD || OSX
+#if LINUX || SOLARIS || SOMEBSD || OSX || GNU
   req.tv_sec = delay / 1000;    /* ms -> seconds */
   req.tv_nsec = (delay - req.tv_sec * 1000) * 1000 * 1000;      /* ms -> ns */
   rem.tv_sec = 0;
--- gnunet.orig/src/setup/text/conf.c	2012-04-29 00:55:51.000000000 +0000
+++ gnunet/src/setup/text/conf.c	2012-04-28 02:33:30.000000000 +0000
@@ -547,11 +547,19 @@
 #  define TCGETS TIOCGETA
 #  define TCSETS TIOCSETA
 #endif
+#if GNU
+  tcgetattr(0, &oldT);
+#else
   ioctl (0, TCGETS, &oldT);
+#endif
   newT = oldT;
   newT.c_lflag &= ~ECHO;
   newT.c_lflag &= ~ICANON;
+#if GNU
+  tcsetattr(0, TCSANOW, &newT);
+#else
   ioctl (0, TCSETS, &newT);
+#endif
 
   printf (_("You can always press ENTER to keep the current value.\n"));
   printf (_("Use the '%s' key to abort.\n"), "q");
@@ -561,13 +569,21 @@
     {
       if (GNUNET_OK != conf (-1, cfg, ectx, root))
         {
+#if GNU
+          tcsetattr(0, TCSANOW, &oldT);
+#else
           ioctl (0, TCSETS, &oldT);
+#endif
           return 1;
         }
       if ((0 == GNUNET_GC_test_dirty (cfg)) && (0 == ACCESS (filename, R_OK)))
         {
           printf (_("Configuration unchanged, no need to save.\n"));
+#if GNU
+          tcsetattr(0, TCSANOW, &oldT);
+#else
           ioctl (0, TCSETS, &oldT);
+#endif
           return 0;
         }
       printf ("\n");
@@ -591,7 +607,11 @@
         }
       else if (ret == -1)
         {                       /* error */
+#if GNU
+          tcsetattr(0, TCSANOW, &oldT);
+#else
           ioctl (0, TCSETS, &oldT);
+#endif
           return 1;
         }
       else
@@ -599,7 +619,11 @@
           printf (_("Configuration file `%s' written.\n"), filename);
         }
     }
+#if GNU
+  tcsetattr(0, TCSANOW, &oldT);
+#else
   ioctl (0, TCSETS, &oldT);
+#endif
   return 0;
 }
 
--- gnunet.orig/src/applications/fs/ecrs/helper.c	2012-04-29 00:57:08.000000000 +0000
+++ gnunet/src/applications/fs/ecrs/helper.c	2012-04-28 02:57:37.000000000 +0000
@@ -354,7 +354,11 @@
                        path,
                        (path[strlen (path) - 1] !=
                         DIR_SEPARATOR) ? DIR_SEPARATOR_STR : "",
+#if GNU
+                       255);
+#else
                        GNUNET_MIN (255, PATH_MAX - strlen (path) - 32), key);
+#endif
     }
   else
     {
@@ -367,8 +371,13 @@
                        path,
                        (path[strlen (path) - 1] !=
                         DIR_SEPARATOR) ? DIR_SEPARATOR_STR : "",
+#if GNU
+                       255 - strlen(mime),
+#else
                        GNUNET_MIN (255 - strlen (mime),
-                                   PATH_MAX - strlen (path) - 64), key,
+                                   PATH_MAX - strlen (path) - 64),
+#endif
+                       key,
                        (strcasecmp
                         (renameTo + strlen (renameTo) - strlen (mime),
                          mime) != 0) ? mime : "");

Reply to: