Bug#761898: xdffileio: FTBFS on hurd-i386
Source: xdffileio
Version: 0.3-1
Severity: important
User: debian-hurd@lists.debian.org
Usertags: hurd
Tags: patch
Hello, xdffileio fails to build from source on GNU/Hurd since one of six
tests fail. The package is also flagged as out-of-date. The failing
test, errortest, fails because the function setrlimit() for the
resource RLIMIT_FSIZE is not yet implemented. The configure check for
setrlimit works, but since the function is not implemented, the file
size test, errortest, fails.
The attached patch, configure.ac.patch, checks for a working
implementation of RLIMIT_FSIZE and is transparent for a future
implementation. This applies to other OSes not yet having this function
implemented. Built (and testsuite run) on GNU/Linux and GNU/Hurd.
(Note: The test program could probably be simplified further, and the
file "test" is not cleaned out after the configure stage).
Thanks!
--- a/configure.ac.orig 2012-05-02 14:07:41.000000000 +0200
+++ b/configure.ac 2014-09-16 17:24:22.000000000 +0200
@@ -48,9 +48,31 @@
# Test missing functions
AC_SEARCH_LIBS([pthread_create], [pthread posix4],
[], AC_MSG_ERROR([The pthread library has not been found]))
-AC_CHECK_FUNC(setrlimit, [run_error_test=true], [run_error_test=false])
AC_CHECK_FUNCS([pthread_sigmask])
+AC_MSG_CHECKING([Define to 1 if if setrlimit RLIMIT_FSIZE works])
+AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <stdlib.h>
+#include <stdio.h>
+ ]],[[
+ struct rlimit rl_zero;
+ rl_zero.rlim_cur = rl_zero.rlim_max = 0;
+ setrlimit(RLIMIT_FSIZE, &rl_zero);
+ FILE *fd = fopen ("./test", "w+");
+ fprintf (fd, "test");
+ fclose (fd);
+ ]])],
+ [AC_MSG_RESULT([no])
+ run_error_test=false],
+ [AC_MSG_RESULT([yes])
+ run_error_test=true
+ AC_DEFINE(HAVE_WORKING_RLIMIT_FSIZE, 1,
+ [setrlimit RLIMIT_FSIZE works])],
+ []
+)
AM_CONDITIONAL(RUN_ERROR_TEST, [test "x$run_error_test" = "xtrue"])
AC_SUBST([CURRENT],[lib_current])
Reply to: