Don't perform AC_FUNC_MALLOC and AC_FUNC_REALLOC when cross-compiling
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 6 Sep 2011 09:53:21 +0000 (11:53 +0200)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 6 Sep 2011 09:55:07 +0000 (11:55 +0200)
Those autoconf tests assume that the target libc doesn't have
GNU-compatible malloc and realloc implementations when cross-compiling,
which breaks compilation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
configure.in

index fd4c70c..9f91313 100644 (file)
@@ -50,8 +50,11 @@ AC_CHECK_MEMBERS([struct stat.st_rdev])
 
 # Checks for library functions.
 AC_HEADER_MAJOR
-AC_FUNC_MALLOC
-AC_FUNC_REALLOC
+AS_IF([test "x$cross_compiling" != "xyes"],
+    [
+        AC_FUNC_MALLOC
+        AC_FUNC_REALLOC
+    ])
 AC_CHECK_FUNCS([memset strerror strrchr strtoul])
 
 AC_CONFIG_FILES([