mirror of
https://github.com/json-c/json-c.git
synced 2026-03-21 22:19:07 +08:00
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 <ardeleanalex@gmail.com>
This commit is contained in:
12
configure.ac
12
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 <math.h>]])
|
||||
AC_CHECK_DECLS([nan], [], [], [[#include <math.h>]])
|
||||
AC_CHECK_DECLS([isnan], [], [], [[#include <math.h>]])
|
||||
@@ -65,6 +67,14 @@ AC_CHECK_DECLS([isinf], [], [], [[#include <math.h>]])
|
||||
AC_CHECK_DECLS([_isnan], [], [], [[#include <float.h>]])
|
||||
AC_CHECK_DECLS([_finite], [], [], [[#include <float.h>]])
|
||||
|
||||
case "${host_os}" in
|
||||
linux*)
|
||||
AC_CHECK_FUNCS([uselocale])
|
||||
;;
|
||||
*) # Nothing
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$ac_cv_have_decl_isnan" = "yes" ; then
|
||||
AC_TRY_LINK([#include <math.h>], [float f = 0.0; return isnan(f)], [], [LIBS="$LIBS -lm"])
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user