Source: tmux
Version: 3.2a-3
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

tmux fails to cross build from source (but 3.1 built), because 3.2
introduced a couple of AC_RUN_IFELSE without a guess for cross
compilation or a suitable cache variable. I think for the relevant
tests, it is best to assume the functions to work when they are present
(during cross compilation). Please consider applying the attached patch.

Helmut
--- tmux-3.2a.orig/configure.ac
+++ tmux-3.2a/configure.ac
@@ -153,6 +153,8 @@
 ])
 AC_FUNC_STRNLEN
 
+AC_CHECK_FUNC([strtonum])
+AS_IF([test "$ac_cv_func_strtonum" = yes],[
 # Check if strtonum works.
 AC_MSG_CHECKING([for working strtonum])
 AC_RUN_IFELSE([AC_LANG_PROGRAM(
@@ -160,12 +162,16 @@
          [return (strtonum("0", 0, 1, NULL) == 0 ? 0 : 1);]
 	 )],
 	 [AC_DEFINE(HAVE_STRTONUM) AC_MSG_RESULT(yes)],
-	 [AC_LIBOBJ(strtonum) AC_MSG_RESULT(no)]
+	 [AC_LIBOBJ(strtonum) AC_MSG_RESULT(no)],
+	 [AC_DEFINE(HAVE_STRTONUM) AC_MSG_RESULT(cross. guessing yes)]
 )
+],[AC_LIBOBJ(strtonum)])
 
 # Clang sanitizers wrap reallocarray even if it isn't available on the target
 # system. When compiled it always returns NULL and crashes the program. To
 # detect this we need a more complicated test.
+AC_CHECK_FUNC([reallocarray])
+AS_IF([test "$ac_cv_func_reallocarray" = yes],[
 AC_MSG_CHECKING([for working reallocarray])
 AC_RUN_IFELSE([AC_LANG_PROGRAM(
 		[#include <stdlib.h>],
@@ -173,8 +179,11 @@
 	)],
 	AC_MSG_RESULT(yes),
 	[AC_LIBOBJ(reallocarray) AC_MSG_RESULT([no])],
-	[AC_LIBOBJ(reallocarray) AC_MSG_RESULT([no])]
+	[AC_MSG_RESULT(cross. guessing yes)]
 )
+],[AC_LIBOBJ(reallocarray)])
+AC_CHECK_FUNC([recallocarray])
+AS_IF([test "$ac_cv_func_recallocarray" = yes],[
 AC_MSG_CHECKING([for working recallocarray])
 AC_RUN_IFELSE([AC_LANG_PROGRAM(
 		[#include <stdlib.h>],
@@ -182,8 +191,9 @@
 	)],
 	AC_MSG_RESULT(yes),
 	[AC_LIBOBJ(recallocarray) AC_MSG_RESULT([no])],
-	[AC_LIBOBJ(recallocarray) AC_MSG_RESULT([no])]
+	[AC_MSG_RESULT(ross. guessing yes)]
 )
+],[AC_LIBOBJ(recallocarray)])
 
 # Look for clock_gettime. Must come before event_init.
 AC_SEARCH_LIBS(clock_gettime, rt)

Reply via email to