annotate m4/remainderf.m4 @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents 9855b352e525
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17355
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
1 # remainderf.m4 serial 8
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16811
diff changeset
2 dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_REMAINDERF],
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
16498
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
9 m4_divert_text([DEFAULTS], [gl_remainderf_required=plain])
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 AC_REQUIRE([gl_MATH_H_DEFAULTS])
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 AC_REQUIRE([gl_FUNC_REMAINDER])
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12
16580
fdbe3125f81a math: Ensure declarations of math functions.
Bruno Haible <bruno@clisp.org>
parents: 16568
diff changeset
13 dnl Persuade glibc <math.h> to declare remainderf().
fdbe3125f81a math: Ensure declarations of math functions.
Bruno Haible <bruno@clisp.org>
parents: 16568
diff changeset
14 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
fdbe3125f81a math: Ensure declarations of math functions.
Bruno Haible <bruno@clisp.org>
parents: 16568
diff changeset
15
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 dnl Test whether remainderf() exists. Assume that remainderf(), if it exists, is
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 dnl defined in the same library as remainder().
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 save_LIBS="$LIBS"
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 LIBS="$LIBS $REMAINDER_LIBM"
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 AC_CACHE_CHECK([for remainderf],
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 [gl_cv_func_remainderf],
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 [
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 AC_LINK_IFELSE(
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 [AC_LANG_PROGRAM(
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 [[#ifndef __NO_MATH_INLINES
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 # define __NO_MATH_INLINES 1 /* for glibc */
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #endif
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include <math.h>
16610
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
29 extern
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
30 #ifdef __cplusplus
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
31 "C"
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
32 #endif
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
33 float remainderf (float, float);
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 float (*funcptr) (float, float) = remainderf;
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 float x;
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 float y;]],
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 [[return funcptr (x, y) > 1
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 || remainderf (x, y) > 1;]])],
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 [gl_cv_func_remainderf=yes],
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 [gl_cv_func_remainderf=no])
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 ])
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 LIBS="$save_LIBS"
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 if test $gl_cv_func_remainderf = yes; then
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 REMAINDERF_LIBM="$REMAINDER_LIBM"
16610
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
45
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
46 save_LIBS="$LIBS"
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
47 LIBS="$LIBS $REMAINDERF_LIBM"
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
48 gl_FUNC_REMAINDERF_WORKS
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
49 LIBS="$save_LIBS"
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
50 case "$gl_cv_func_remainderf_works" in
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
51 *yes) ;;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
52 *) REPLACE_REMAINDERF=1 ;;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
53 esac
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
54
16498
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
55 m4_ifdef([gl_FUNC_REMAINDERF_IEEE], [
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
56 if test $gl_remainderf_required = ieee && test $REPLACE_REMAINDERF = 0; then
16811
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
57 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
16498
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
58 AC_CACHE_CHECK([whether remainderf works according to ISO C 99 with IEC 60559],
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
59 [gl_cv_func_remainderf_ieee],
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
60 [
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
61 save_LIBS="$LIBS"
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
62 LIBS="$LIBS $REMAINDERF_LIBM"
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
63 AC_RUN_IFELSE(
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
64 [AC_LANG_SOURCE([[
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
65 #ifndef __NO_MATH_INLINES
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
66 # define __NO_MATH_INLINES 1 /* for glibc */
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
67 #endif
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
68 #include <math.h>
16610
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
69 extern
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
70 #ifdef __cplusplus
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
71 "C"
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
72 #endif
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
73 float remainderf (float, float);
16498
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
74 /* Compare two numbers with ==.
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
75 This is a separate function because IRIX 6.5 "cc -O" miscompiles an
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
76 'x == x' test. */
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
77 static int
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
78 numeric_equal (float x, float y)
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
79 {
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
80 return x == y;
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
81 }
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
82 static float dummy (float x, float y) { return 0; }
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
83 int main (int argc, char *argv[])
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
84 {
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
85 float (*my_remainderf) (float, float) = argc ? remainderf : dummy;
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
86 float f;
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
87 /* Test remainderf(...,0.0f).
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
88 This test fails on OSF/1 5.1. */
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
89 f = my_remainderf (2.0f, 0.0f);
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
90 if (numeric_equal (f, f))
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
91 return 1;
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
92 return 0;
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
93 }
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
94 ]])],
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
95 [gl_cv_func_remainderf_ieee=yes],
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
96 [gl_cv_func_remainderf_ieee=no],
16811
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
97 [case "$host_os" in
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
98 # Guess yes on glibc systems.
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
99 *-gnu*) gl_cv_func_remainderf_ieee="guessing yes" ;;
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
100 # If we don't know, assume the worst.
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
101 *) gl_cv_func_remainderf_ieee="guessing no" ;;
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
102 esac
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16648
diff changeset
103 ])
16498
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
104 LIBS="$save_LIBS"
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
105 ])
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
106 case "$gl_cv_func_remainderf_ieee" in
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
107 *yes) ;;
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
108 *) REPLACE_REMAINDERF=1 ;;
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
109 esac
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
110 fi
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
111 ])
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 else
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 HAVE_REMAINDERF=0
16498
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
114 fi
e04c5a489c44 remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents: 16413
diff changeset
115 if test $HAVE_REMAINDERF = 0 || test $REPLACE_REMAINDERF = 1; then
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 dnl Find libraries needed to link lib/remainderf.c.
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 if test $gl_cv_func_remainder_no_libm = yes \
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 || test $gl_cv_func_remainder_in_libm = yes; then
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 AC_DEFINE([HAVE_REMAINDER], [1],
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 [Define to 1 if the remainder() function is available in libc or libm.])
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 REMAINDERF_LIBM="$REMAINDER_LIBM"
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 else
16568
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
123 AC_REQUIRE([gl_FUNC_FABSF])
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
124 AC_REQUIRE([gl_FUNC_FMODF])
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
125 AC_REQUIRE([gl_FUNC_ISNANF])
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 REMAINDERF_LIBM=
16568
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
127 dnl Append $FABSF_LIBM to REMAINDERF_LIBM, avoiding gratuitous duplicates.
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 case " $REMAINDERF_LIBM " in
16568
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
129 *" $FABSF_LIBM "*) ;;
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
130 *) REMAINDERF_LIBM="$REMAINDERF_LIBM $FABSF_LIBM" ;;
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 esac
16568
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
132 dnl Append $FMODF_LIBM to REMAINDERF_LIBM, avoiding gratuitous duplicates.
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 case " $REMAINDERF_LIBM " in
16568
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
134 *" $FMODF_LIBM "*) ;;
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
135 *) REMAINDERF_LIBM="$REMAINDERF_LIBM $FMODF_LIBM" ;;
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
136 esac
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
137 dnl Append $ISNANF_LIBM to REMAINDERF_LIBM, avoiding gratuitous duplicates.
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
138 case " $REMAINDERF_LIBM " in
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
139 *" $ISNANF_LIBM "*) ;;
8fec0d45d1a8 remainder, remainderf, remainderl: Fix computation for large quotients.
Bruno Haible <bruno@clisp.org>
parents: 16498
diff changeset
140 *) REMAINDERF_LIBM="$REMAINDERF_LIBM $ISNANF_LIBM" ;;
16413
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 esac
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 fi
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 fi
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144 AC_SUBST([REMAINDERF_LIBM])
3a9564d7a3a5 New module 'remainderf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145 ])
16610
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
146
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
147 dnl Test whether remainderf() works.
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
148 dnl It runs into an endless loop on IRIX 6.5.
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
149 AC_DEFUN([gl_FUNC_REMAINDERF_WORKS],
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
150 [
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
151 AC_REQUIRE([AC_PROG_CC])
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
152 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
17355
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
153 AC_CHECK_DECLS_ONCE([alarm])
16610
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
154 AC_CACHE_CHECK([whether remainderf works], [gl_cv_func_remainderf_works],
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
155 [
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
156 AC_RUN_IFELSE(
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
157 [AC_LANG_SOURCE([[
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
158 #include <math.h>
17355
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
159 #if HAVE_DECL_ALARM
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
160 # include <signal.h>
16610
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
161 # include <unistd.h>
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
162 #endif
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
163 extern
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
164 #ifdef __cplusplus
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
165 "C"
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
166 #endif
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
167 float remainderf (float, float);
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
168 volatile float x;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
169 volatile float y;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
170 float z;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
171 int main ()
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
172 {
17355
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
173 #if HAVE_DECL_ALARM
9855b352e525 regex: port to mingw's recent addition of undeclared alarm
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
174 signal (SIGALRM, SIG_DFL);
16610
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
175 alarm (5);
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
176 #endif
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
177 /* This test fails on IRIX 6.5. */
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
178 x = 9.316161e+37f;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
179 y = 0.5475547314f;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
180 z = remainderf (x, y);
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
181 return 0;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
182 }
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
183 ]])],
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
184 [gl_cv_func_remainderf_works=yes],
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
185 [gl_cv_func_remainderf_works=no],
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
186 [case "$host_os" in
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
187 irix*) gl_cv_func_remainderf_works="guessing no";;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
188 *) gl_cv_func_remainderf_works="guessing yes";;
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
189 esac
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
190 ])
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
191 ])
ef330e58b855 remainderf: Override buggy system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16580
diff changeset
192 ])