Source: stressapptest
Version: 1.0.6-2
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

stressapptest fails to cross build from source, because it uses
AC_TRY_RUN. Indeed, it uses a cache variable, so it can be made to cross
build in principle. However, the check does not actually need to perform
any test. All it needs to know is whether the pthread_barrier_t type
exists. For that check, AC_CHECK_TYPE is better suited and it works
without extra effort during cross builds. Please consider applying the
attached patch.

Helmut
--- stressapptest-1.0.6.orig/configure.ac
+++ stressapptest-1.0.6/configure.ac
@@ -120,26 +120,9 @@
 AC_CHECK_HEADERS([sys/shm.h])
 AC_SEARCH_LIBS([shm_open], [rt])
 
-AC_MSG_CHECKING(for pthread_barrier)
-AC_CACHE_VAL(
-  ac_cv_func_pthread_barrier,
-  AC_TRY_RUN(
-    [
-      #include <pthread.h>
-      int main(void)
-      {
-        pthread_barrier_t t;
-        return 0;
-      }
-    ],
-    ac_cv_func_pthread_barrier=yes,
-    ac_cv_func_pthread_barrier=no
-  )
-)
-AC_MSG_RESULT($ac_cv_func_pthread_barrier)
-if test "$ac_cv_func_pthread_barrier" = "yes"; then
+AC_CHECK_TYPE([pthread_barrier_t],[
   AC_DEFINE(HAVE_PTHREAD_BARRIER, [1], [Define to 1 if the system has `pthread_barrier'.])
-fi
+],[],[#include <pthread.h>])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL

Reply via email to