Source: inn2
Version: 2.6.3-3
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

inn2 fails to cross build from source, because its check for IOV_MAX
doesn't work during cross compilation. The check actually tries to do
two things in one check: 1. Figure out whether IOV_MAX is defined. 2.
Figure out a suitable value for IOV_MAX in case it isn't defined. The
second part cannot be easily ported to cross compilation, but luckily
our C library does provide IOV_MAX, so using AC_CHECK_DECL avoids the
need for our cause. The attached patch adapts the check. Please consider
applying it.

Helmut
--- inn2-2.6.3.orig/m4/iov-max.m4
+++ inn2-2.6.3/m4/iov-max.m4
@@ -38,9 +38,6 @@
   FILE *f = fopen ("conftestval", "w");
   if (f == NULL)
     return 1;
-#ifdef IOV_MAX
-  fprintf (f, "set in limits.h\n");
-#else
 # ifdef UIO_MAXIOV
   fprintf (f, "%d\n", UIO_MAXIOV);
 # else
@@ -61,14 +58,14 @@
     }
   fprintf (f, "1024\n");
 # endif /* UIO_MAXIOV */
-#endif /* IOV_MAX */
   return 0;
 }
 ]])])
 
 dnl Do the actual check.
 AC_DEFUN([INN_MACRO_IOV_MAX],
-[AC_CACHE_CHECK([value of IOV_MAX],
+[AC_CHECK_DECL([IOV_MAX],[],
+  [AC_CACHE_CHECK([value of IOV_MAX],
     [inn_cv_macro_iov_max],
     [AC_RUN_IFELSE([_INN_MACRO_IOV_MAX_SOURCE],
         inn_cv_macro_iov_max=`cat conftestval`,
@@ -78,7 +75,18 @@
          AC_MSG_WARN([probe failure, assuming 16])
          inn_cv_macro_iov_max=16
      fi])
- if test x"$inn_cv_macro_iov_max" != x"set in limits.h" ; then
     AC_DEFINE_UNQUOTED(IOV_MAX, $inn_cv_macro_iov_max,
                        [Define to the max vectors in an iovec.])
- fi])
+ ],[
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/uio.h>
+#include <errno.h>
+#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+])])

Reply via email to