Mercurial > hg > octave-shane > gnulib-hg
annotate m4/remainderf.m4 @ 17536:ea01543bbca7
install-reloc: Support multi-binary installation.
* build-aux/install-reloc: Support installing multiple programs in
one invocation, as done by Automake starting with commit
4295fe33eb23f (Multi-file install for PROGRAMS.). From Bruno
Haible <bruno@clisp.org>, archived at
http://lists.debian.org/debian-bsd/2012/05/msg00032.html.
Reported by Sylvain <beuc@gnu.org>.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 21 Oct 2013 22:48:35 -0700 |
parents | 9855b352e525 |
children | 344018b6e5d7 |
rev | line source |
---|---|
17366
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 | 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_REMAINDERF], | |
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 | 10 AC_REQUIRE([gl_MATH_H_DEFAULTS]) |
11 AC_REQUIRE([gl_FUNC_REMAINDER]) | |
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 | 16 dnl Test whether remainderf() exists. Assume that remainderf(), if it exists, is |
17 dnl defined in the same library as remainder(). | |
18 save_LIBS="$LIBS" | |
19 LIBS="$LIBS $REMAINDER_LIBM" | |
20 AC_CACHE_CHECK([for remainderf], | |
21 [gl_cv_func_remainderf], | |
22 [ | |
23 AC_LINK_IFELSE( | |
24 [AC_LANG_PROGRAM( | |
25 [[#ifndef __NO_MATH_INLINES | |
26 # define __NO_MATH_INLINES 1 /* for glibc */ | |
27 #endif | |
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 | 34 float (*funcptr) (float, float) = remainderf; |
35 float x; | |
36 float y;]], | |
37 [[return funcptr (x, y) > 1 | |
38 || remainderf (x, y) > 1;]])], | |
39 [gl_cv_func_remainderf=yes], | |
40 [gl_cv_func_remainderf=no]) | |
41 ]) | |
42 LIBS="$save_LIBS" | |
43 if test $gl_cv_func_remainderf = yes; then | |
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 | 112 else |
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 | 116 dnl Find libraries needed to link lib/remainderf.c. |
117 if test $gl_cv_func_remainder_no_libm = yes \ | |
118 || test $gl_cv_func_remainder_in_libm = yes; then | |
119 AC_DEFINE([HAVE_REMAINDER], [1], | |
120 [Define to 1 if the remainder() function is available in libc or libm.]) | |
121 REMAINDERF_LIBM="$REMAINDER_LIBM" | |
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 | 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 | 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 | 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 | 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 | 141 esac |
142 fi | |
143 fi | |
144 AC_SUBST([REMAINDERF_LIBM]) | |
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 |
17366
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> |
17366
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 { |
17366
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 ]) |