2 dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
9 AC_REQUIRE([AC_PROG_CC])
10 AC_REQUIRE([AC_CANONICAL_HOST])
11 GL_GENERATE_FLOAT_H=false
14 aix* | beos* | openbsd* | mirbsd* | irix*)
15 GL_GENERATE_FLOAT_H=true
17 freebsd* | dragonfly*)
22 GL_GENERATE_FLOAT_H=true
25 # On x86_64 systems, the C compiler may still be generating
29 [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
36 [GL_GENERATE_FLOAT_H=true])
43 GL_GENERATE_FLOAT_H=true
49 aix* | freebsd* | dragonfly* | linux*)
50 if $GL_GENERATE_FLOAT_H; then
56 dnl Test against glibc-2.7 Linux/SPARC64 bug.
58 AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
59 [gl_cv_func_itold_works],
64 volatile long double ld;
72 [gl_cv_func_itold_works=yes],
73 [gl_cv_func_itold_works=no],
78 [[#if defined __LP64__ || defined __arch64__
84 [gl_cv_func_itold_works="guessing no"],
85 [gl_cv_func_itold_works="guessing yes"])
87 # Guess yes on native Windows.
88 mingw*) gl_cv_func_itold_works="guessing yes" ;;
89 *) gl_cv_func_itold_works="guessing yes" ;;
93 case "$gl_cv_func_itold_works" in
96 dnl We add the workaround to <float.h> but also to <math.h>,
97 dnl to increase the chances that the fix function gets pulled in.
98 GL_GENERATE_FLOAT_H=true
102 if $GL_GENERATE_FLOAT_H; then
103 gl_NEXT_HEADERS([float.h])
105 AC_SUBST([REPLACE_ITOLD])