build-sys: omit mustach compilation when it cannot work

For example mac does not have open_memstream(3), and strndupa(3) can also be
missing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-11-11 16:13:14 +00:00
parent b96f8cd8ad
commit 39b2811aa7
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
6 changed files with 31 additions and 4 deletions

View file

@ -69,8 +69,18 @@ AC_TYPE_UINT32_T
AC_FUNC_ERROR_AT_LINE
AC_CHECK_FUNCS([\
__fpending \
open_memstream \
posix_fadvise \
])
AC_CHECK_DECL([strndupa])
AS_IF([test "x$ac_cv_func_open_memstream" = "xyes" && test "x$ac_cv_have_decl_strndupa" == "xyes"], [
build_mustach=yes
AC_DEFINE([BUILD_MUSTACH], [1], [build mustach support])
], [
build_mustach=no
])
AM_CONDITIONAL([ENABLE_MUSTACH], [test "x$build_mustach" = xyes])
AC_MSG_CHECKING([if the compiler supports __builtin_expect])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[