From 1ba4fd0cecd8ca007afa34d0da06b5ab47bee8f2 Mon Sep 17 00:00:00 2001 From: tijuca Date: Fri, 22 Apr 2016 12:30:45 -0700 Subject: [PATCH] Cross compilation issue (#31) The error that happen while cross compiling is quite logical if you know what the check AC_FUNC_MALLOC is made for. The behavior isn't really wrong (for me) because autoconf can't really test the created code due it's for another platform. Some nice explanation about the whole problem can be found here: http://wiki.buici.com/xwiki/bin/view/Programing+C+and+C%2B%2B/Autoconf+and+RPL_MALLOC As long as libcoap uses malloc from the libc we need a check for the proper implementation for this cases. So removing AC_FUNC_MALLOC isn't solving the problem. We need at least a check for a malloc functionality which can be done by AC_CHECK_FUNC(S). (cherry picked from commit 04d806fe4dc3816231494c91ae8cca8109498aa3) --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a6ad049c..0e455836 100644 --- a/configure.ac +++ b/configure.ac @@ -284,9 +284,8 @@ AC_TYPE_SIZE_T AC_TYPE_SSIZE_T # Checks for library functions. -AC_FUNC_MALLOC AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo \ - strnlen]) + strnlen malloc]) # Check if -lsocket -lnsl is required (specifically Solaris) AC_SEARCH_LIBS([socket], [socket])