51
58
[gl_cv_func_signbit_gcc=yes],
52
59
[gl_cv_func_signbit_gcc=no],
53
[gl_cv_func_signbit_gcc="guessing no"])
61
# Guess yes on glibc systems.
62
*-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
63
# If we don't know, assume the worst.
64
*) gl_cv_func_signbit_gcc="guessing no" ;;
55
68
dnl Use the compiler built-ins whenever possible, because they are more
56
69
dnl efficient than the system library functions (if they exist).
57
if test "$gl_cv_func_signbit_gcc" = yes; then
58
REPLACE_SIGNBIT_USING_GCC=1
60
if test "$gl_cv_func_signbit" != yes; then
61
dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
63
gl_FLOAT_SIGN_LOCATION
64
gl_DOUBLE_SIGN_LOCATION
65
gl_LONG_DOUBLE_SIGN_LOCATION
66
if test "$gl_cv_cc_float_signbit" = unknown; then
67
dnl Test whether copysignf() is declared.
68
AC_CHECK_DECLS([copysignf], , , [#include <math.h>])
69
if test "$ac_cv_have_decl_copysignf" = yes; then
70
dnl Test whether copysignf() can be used without libm.
71
AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
72
[gl_cv_func_copysignf_no_libm],
78
[[return copysignf (x, y) < 0;]])],
79
[gl_cv_func_copysignf_no_libm=yes],
80
[gl_cv_func_copysignf_no_libm=no])
82
if test $gl_cv_func_copysignf_no_libm = yes; then
83
AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
84
[Define if the copysignf function is declared in <math.h> and available in libc.])
88
if test "$gl_cv_cc_double_signbit" = unknown; then
89
dnl Test whether copysign() is declared.
90
AC_CHECK_DECLS([copysign], , , [#include <math.h>])
91
if test "$ac_cv_have_decl_copysign" = yes; then
92
dnl Test whether copysign() can be used without libm.
93
AC_CACHE_CHECK([whether copysign can be used without linking with libm],
94
[gl_cv_func_copysign_no_libm],
100
[[return copysign (x, y) < 0;]])],
101
[gl_cv_func_copysign_no_libm=yes],
102
[gl_cv_func_copysign_no_libm=no])
104
if test $gl_cv_func_copysign_no_libm = yes; then
105
AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
106
[Define if the copysign function is declared in <math.h> and available in libc.])
110
if test "$gl_cv_cc_long_double_signbit" = unknown; then
111
dnl Test whether copysignl() is declared.
112
AC_CHECK_DECLS([copysignl], , , [#include <math.h>])
113
if test "$ac_cv_have_decl_copysignl" = yes; then
114
dnl Test whether copysignl() can be used without libm.
115
AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
116
[gl_cv_func_copysignl_no_libm],
122
[[return copysignl (x, y) < 0;]])],
123
[gl_cv_func_copysignl_no_libm=yes],
124
[gl_cv_func_copysignl_no_libm=no])
126
if test $gl_cv_func_copysignl_no_libm = yes; then
127
AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
128
[Define if the copysignl function is declared in <math.h> and available in libc.])
70
case "$gl_cv_func_signbit_gcc" in
72
REPLACE_SIGNBIT_USING_GCC=1
75
case "$gl_cv_func_signbit" in
78
dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
80
gl_FLOAT_SIGN_LOCATION
81
gl_DOUBLE_SIGN_LOCATION
82
gl_LONG_DOUBLE_SIGN_LOCATION
83
if test "$gl_cv_cc_float_signbit" = unknown; then
84
dnl Test whether copysignf() is declared.
85
AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
86
if test "$ac_cv_have_decl_copysignf" = yes; then
87
dnl Test whether copysignf() can be used without libm.
88
AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
89
[gl_cv_func_copysignf_no_libm],
95
[[return copysignf (x, y) < 0;]])],
96
[gl_cv_func_copysignf_no_libm=yes],
97
[gl_cv_func_copysignf_no_libm=no])
99
if test $gl_cv_func_copysignf_no_libm = yes; then
100
AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
101
[Define if the copysignf function is declared in <math.h> and available in libc.])
105
if test "$gl_cv_cc_double_signbit" = unknown; then
106
dnl Test whether copysign() is declared.
107
AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
108
if test "$ac_cv_have_decl_copysign" = yes; then
109
dnl Test whether copysign() can be used without libm.
110
AC_CACHE_CHECK([whether copysign can be used without linking with libm],
111
[gl_cv_func_copysign_no_libm],
117
[[return copysign (x, y) < 0;]])],
118
[gl_cv_func_copysign_no_libm=yes],
119
[gl_cv_func_copysign_no_libm=no])
121
if test $gl_cv_func_copysign_no_libm = yes; then
122
AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
123
[Define if the copysign function is declared in <math.h> and available in libc.])
127
if test "$gl_cv_cc_long_double_signbit" = unknown; then
128
dnl Test whether copysignl() is declared.
129
AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
130
if test "$ac_cv_have_decl_copysignl" = yes; then
131
dnl Test whether copysignl() can be used without libm.
132
AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
133
[gl_cv_func_copysignl_no_libm],
139
[[return copysignl (x, y) < 0;]])],
140
[gl_cv_func_copysignl_no_libm=yes],
141
[gl_cv_func_copysignl_no_libm=no])
143
if test $gl_cv_func_copysignl_no_libm = yes; then
144
AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
145
[Define if the copysignl function is declared in <math.h> and available in libc.])
136
155
AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[