Source: canlock
Version: 3.0.2-1
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

canlock fails to cross build from source, because it uses AC_RUN_IFELSE
to determine whether memset_s is available. For simply checking
availability and checking whether the prototype matches,
AC_COMPILE_IFELSE is sufficient. The attached patch adapts the check and
thus makes canlock work with cross compilation. Please consider applying
it.

Helmut
--- canlock-3.0.2.orig/configure.ac
+++ canlock-3.0.2/configure.ac
@@ -161,17 +161,18 @@
 dnl Check whether 'memset_s()' from C11 Annex K is usable
 dnl (Double quoting is used to protect square brackets of source code)
 AC_MSG_CHECKING([for memset_s])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                                   /* Request C11 Annex K */
                                   #define __STDC_WANT_LIB_EXT1__ 1
                                   #include <string.h>
                                   char buf[10] = { 1 };
-                                  errno_t rv;
                                ]],
                                [
-                                  rv = memset_s((void*) buf, (size_t) 100,
-                                                0, (size_t) 1);
-                                  if (rv)  return(-1);
+				  #ifndef __STDC_LIB_EXT1__
+				  # error memset_s unavailable
+				  #endif
+                                  memset_s((void*) buf, (size_t) 100,
+                                           0, (size_t) 1);
                                ])],
               [
                  AC_MSG_RESULT([yes])

Reply via email to