From 85f57859fd2ba20c7366f00e1fbaf94c4b264010 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Thu, 13 Jul 2017 09:33:39 +0300 Subject: [PATCH] configure.ac: check for `uselocale` function only on Linux platforms On Apple this seems to fail the `test_locale` test, which would imply that the `uselocale` function does not behave as expected. Signed-off-by: Alexandru Ardelean --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3a2779e..bbaacf5 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,8 @@ AM_INIT_AUTOMAKE AC_PROG_MAKE_SET +AC_CANONICAL_HOST + AC_ARG_ENABLE(rdrand, AS_HELP_STRING([--enable-rdrand], [Enable RDRAND Hardware RNG Hash Seed generation on supported x86/x64 platforms.]), @@ -57,7 +59,7 @@ AS_IF([test "x$ac_cv___thread" != xno], AC_FUNC_VPRINTF AC_FUNC_MEMCMP AC_CHECK_FUNCS([realloc]) -AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale uselocale) +AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale) AC_CHECK_DECLS([INFINITY], [], [], [[#include ]]) AC_CHECK_DECLS([nan], [], [], [[#include ]]) AC_CHECK_DECLS([isnan], [], [], [[#include ]]) @@ -65,6 +67,14 @@ AC_CHECK_DECLS([isinf], [], [], [[#include ]]) AC_CHECK_DECLS([_isnan], [], [], [[#include ]]) AC_CHECK_DECLS([_finite], [], [], [[#include ]]) +case "${host_os}" in + linux*) + AC_CHECK_FUNCS([uselocale]) + ;; + *) # Nothing + ;; +esac + if test "$ac_cv_have_decl_isnan" = "yes" ; then AC_TRY_LINK([#include ], [float f = 0.0; return isnan(f)], [], [LIBS="$LIBS -lm"]) fi