3 dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
10 AC_REQUIRE([AC_PROG_CC])
11 AC_REQUIRE([AC_CANONICAL_HOST])
12 GL_GENERATE_FLOAT_H=false
15 aix* | beos* | openbsd* | mirbsd* | irix*)
16 GL_GENERATE_FLOAT_H=true
18 freebsd* | dragonfly*)
23 GL_GENERATE_FLOAT_H=true
26 # On x86_64 systems, the C compiler may still be generating
30 [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
37 [GL_GENERATE_FLOAT_H=true])
44 GL_GENERATE_FLOAT_H=true
50 aix* | freebsd* | dragonfly* | linux*)
51 if $GL_GENERATE_FLOAT_H; then
57 dnl Test against glibc-2.7 Linux/SPARC64 bug.
59 AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
60 [gl_cv_func_itold_works],
65 volatile long double ld;
73 [gl_cv_func_itold_works=yes],
74 [gl_cv_func_itold_works=no],
79 [[#if defined __LP64__ || defined __arch64__
85 [gl_cv_func_itold_works="guessing no"],
86 [gl_cv_func_itold_works="guessing yes"])
88 # Guess yes on native Windows.
90 gl_cv_func_itold_works="guessing yes" ;;
92 gl_cv_func_itold_works="guessing yes" ;;
96 case "$gl_cv_func_itold_works" in
99 dnl We add the workaround to <float.h> but also to <math.h>,
100 dnl to increase the chances that the fix function gets pulled in.
101 GL_GENERATE_FLOAT_H=true
105 if $GL_GENERATE_FLOAT_H; then
106 gl_NEXT_HEADERS([float.h])
108 AC_SUBST([REPLACE_ITOLD])