Mercurial > gnulib
annotate m4/logbf.m4 @ 39913:73d60b1f9c96
doc: Update for Solaris 11.4.
* doc/**/*.texi: For bugs that exist in both Solaris 11.3 and 11.4,
mention Solaris 11.4.
* m4/printf.m4: Update comments about Solaris.
* m4/log.m4: Likewise.
* m4/log10.m4: Likewise.
* m4/logb.m4: Likewise.
* m4/logbf.m4: Likewise.
* m4/logbl.m4: Likewise.
* m4/rename.m4: Likewise.
* m4/wcrtomb.m4: Likewise.
* m4/hostent.m4: Likewise.
* m4/servent.m4: Likewise.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 14 Oct 2018 09:33:46 +0200 |
parents | 10eb9086bea0 |
children | b06060465f09 |
rev | line source |
---|---|
39913
73d60b1f9c96
doc: Update for Solaris 11.4.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
1 # logbf.m4 serial 3 |
19484
10eb9086bea0
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
18993
diff
changeset
|
2 dnl Copyright (C) 2012-2018 Free Software Foundation, Inc. |
16753 | 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. | |
6 | |
7 AC_DEFUN([gl_FUNC_LOGBF], | |
8 [ | |
9 AC_REQUIRE([gl_MATH_H_DEFAULTS]) | |
10 | |
11 dnl Persuade glibc <math.h> to declare logbf(). | |
12 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | |
13 | |
14 dnl Determine LOGBF_LIBM. | |
15 gl_MATHFUNC([logbf], [float], [(float)]) | |
16 if test $gl_cv_func_logbf_no_libm = yes \ | |
17 || test $gl_cv_func_logbf_in_libm = yes; then | |
18 save_LIBS="$LIBS" | |
19 LIBS="$LIBS $LOGBF_LIBM" | |
20 gl_FUNC_LOGBF_WORKS | |
21 LIBS="$save_LIBS" | |
22 case "$gl_cv_func_logbf_works" in | |
23 *yes) ;; | |
24 *) REPLACE_LOGBF=1 ;; | |
25 esac | |
26 else | |
27 HAVE_LOGBF=0 | |
28 fi | |
29 if test $HAVE_LOGBF = 0 || test $REPLACE_LOGBF = 1; then | |
30 dnl Find libraries needed to link lib/logbf.c. | |
31 AC_REQUIRE([gl_FUNC_FREXPF]) | |
32 AC_REQUIRE([gl_FUNC_ISNANF]) | |
33 LOGBF_LIBM= | |
34 dnl Append $FREXPF_LIBM to LOGBF_LIBM, avoiding gratuitous duplicates. | |
35 case " $LOGBF_LIBM " in | |
36 *" $FREXPF_LIBM "*) ;; | |
37 *) LOGBF_LIBM="$LOGBF_LIBM $FREXPF_LIBM" ;; | |
38 esac | |
39 dnl Append $ISNANF_LIBM to LOGBF_LIBM, avoiding gratuitous duplicates. | |
40 case " $LOGBF_LIBM " in | |
41 *" $ISNANF_LIBM "*) ;; | |
42 *) LOGBF_LIBM="$LOGBF_LIBM $ISNANF_LIBM" ;; | |
43 esac | |
44 fi | |
45 AC_SUBST([LOGBF_LIBM]) | |
46 ]) | |
47 | |
48 dnl Test whether logbf() works. | |
49 dnl On glibc 2.11/ppc, glibc 2.7/sparc, glibc 2.7/hppa, Solaris 10/SPARC, | |
39913
73d60b1f9c96
doc: Update for Solaris 11.4.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
50 dnl Solaris 11.4/x86_64, the return value for subnormal (denormalized) arguments |
73d60b1f9c96
doc: Update for Solaris 11.4.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
51 dnl is too large. |
16753 | 52 AC_DEFUN([gl_FUNC_LOGBF_WORKS], |
53 [ | |
54 AC_REQUIRE([AC_PROG_CC]) | |
55 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles | |
56 AC_CACHE_CHECK([whether logbf works], [gl_cv_func_logbf_works], | |
57 [ | |
58 AC_RUN_IFELSE( | |
59 [AC_LANG_SOURCE([[ | |
60 #include <float.h> | |
61 #include <math.h> | |
62 volatile float x; | |
63 int main () | |
64 { | |
65 int i; | |
66 for (i = 1, x = 1.0f; i >= FLT_MIN_EXP; i--, x *= 0.5f) | |
67 ; | |
68 /* Here i = FLT_MIN_EXP - 1. Either x = 2^(i-1) is subnormal or x = 0.0. */ | |
69 if (x > 0.0f && !(logbf (x) == (float)(i - 1))) | |
70 return 1; | |
71 return 0; | |
72 } | |
73 ]])], | |
74 [gl_cv_func_logbf_works=yes], | |
75 [gl_cv_func_logbf_works=no], | |
76 [case "$host_os" in | |
18993
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
77 *gnu* | solaris*) gl_cv_func_logbf_works="guessing no" ;; |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
78 mingw*) # Guess yes on MSVC, no on mingw. |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
79 AC_EGREP_CPP([Known], [ |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
80 #ifdef _MSC_VER |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
81 Known |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
82 #endif |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
83 ], |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
84 [gl_cv_func_logbf_works="guessing yes"], |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
85 [gl_cv_func_logbf_works="guessing no"]) |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
86 ;; |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
87 *) gl_cv_func_logbf_works="guessing yes" ;; |
16753 | 88 esac |
89 ]) | |
90 ]) | |
91 ]) |