提交 9eb887af authored 作者: Michael Jerris's avatar Michael Jerris 提交者: Brian West

fix clang build on wheezy and other platforms that have aligned_alloc in libc but not in headers

上级 bc3fa1b9
......@@ -37,6 +37,27 @@ m4_include(m4/ax_c99_features.m4)
m4_include(m4/ax_check_export_capability.m4)
m4_include(m4/ax_check_arm_neon.m4)
AC_DEFUN([AC_FUNC_ALIGNED_ALLOC],[
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_CACHE_CHECK([checking for aligned_alloc],
[ac_cv_func_aligned_alloc],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
#define _ISOC11_SOURCE
#include <stdlib.h>
],
[
aligned_alloc(0,0);
])],
[ac_cv_func_aligned_alloc=yes],
[ac_cv_func_aligned_alloc=no])])
if test "x${ac_cv_func_aligned_alloc}" = "xyes" ; then
AC_DEFINE([HAVE_ALIGNED_ALLOC], [1], [Define to 1 if you have the aligned_alloc() function.])
fi
CFLAGS="$saved_CFLAGS"
])
AC_CONFIG_SRCDIR([src/tone_generate.c])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
......@@ -174,7 +195,7 @@ fi
AX_C99_FLEXIBLE_ARRAY
AC_CHECK_FUNCS([aligned_alloc])
AC_FUNC_ALIGNED_ALLOC
AC_CHECK_FUNCS([memalign])
AC_CHECK_FUNCS([posix_memalign])
AC_CHECK_FUNCS([memmove])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论