]> granicus.if.org Git - json-c/commitdiff
configure: check realloc with AC_CHECK_FUNCS() to fix cross-compilation.
authorJehan <jehan@girinstud.io>
Fri, 1 Jan 2016 17:35:14 +0000 (18:35 +0100)
committerJehan <jehan@girinstud.io>
Fri, 1 Jan 2016 17:46:02 +0000 (18:46 +0100)
AC_FUNC_REALLOC is messed up when cross-compiling, ending up in failed
build with "undefined reference to `rpl_realloc'" error.
AC_CHECK_FUNCS will work both with native and cross builds.

configure.ac

index 2f3c92ff33cfd74ddcdb17bb91ec18766ecc708e..cdae29245c4295c1b3663236832dfc0c2bfe308e 100644 (file)
@@ -43,7 +43,7 @@ AC_TYPE_SIZE_T
 # Checks for library functions.
 AC_FUNC_VPRINTF
 AC_FUNC_MEMCMP
-AC_FUNC_REALLOC
+AC_CHECK_FUNCS([realloc])
 AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale)
 AC_CHECK_DECLS([INFINITY], [], [], [[#include <math.h>]])
 AC_CHECK_DECLS([nan], [], [], [[#include <math.h>]])