annotate m4/exp2l.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 e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16811
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
1 # exp2l.m4 serial 3
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16811
diff changeset
2 dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
16620
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_EXP2L],
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
16628
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
9 m4_divert_text([DEFAULTS], [gl_exp2l_required=plain])
16620
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 AC_REQUIRE([gl_MATH_H_DEFAULTS])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 AC_REQUIRE([gl_FUNC_EXP2])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 dnl Persuade glibc <math.h> to declare exp2l().
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 dnl Test whether exp2l() exists. Assume that exp2l(), if it exists, is
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 dnl defined in the same library as exp2().
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 save_LIBS="$LIBS"
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 LIBS="$LIBS $EXP2_LIBM"
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 AC_CHECK_FUNCS([exp2l])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 LIBS="$save_LIBS"
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 if test $ac_cv_func_exp2l = yes; then
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 HAVE_EXP2L=1
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 EXP2L_LIBM="$EXP2_LIBM"
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 dnl Also check whether it's declared.
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 dnl IRIX 6.5 has exp2l() in libm but doesn't declare it in <math.h>.
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 AC_CHECK_DECL([exp2l], , [HAVE_DECL_EXP2L=0], [[#include <math.h>]])
16628
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
29 m4_ifdef([gl_FUNC_EXP2L_IEEE], [
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
30 if test $gl_exp2l_required = ieee && test $REPLACE_EXP2L = 0; then
16811
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
31 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
16628
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
32 AC_CACHE_CHECK([whether exp2l works according to ISO C 99 with IEC 60559],
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
33 [gl_cv_func_exp2l_ieee],
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
34 [
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
35 save_LIBS="$LIBS"
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
36 LIBS="$LIBS $EXP2L_LIBM"
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
37 AC_RUN_IFELSE(
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
38 [AC_LANG_SOURCE([[
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
39 #ifndef __NO_MATH_INLINES
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
40 # define __NO_MATH_INLINES 1 /* for glibc */
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
41 #endif
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
42 #include <math.h>
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
43 #undef exp2l
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
44 extern
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
45 #ifdef __cplusplus
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
46 "C"
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
47 #endif
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
48 long double exp2l (long double);
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
49 static long double dummy (long double x) { return 0; }
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
50 static long double zero;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
51 int main (int argc, char *argv[])
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
52 {
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
53 long double (*my_exp2l) (long double) = argc ? exp2l : dummy;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
54 int result = 0;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
55 /* This test fails on OpenBSD 4.9, where exp2l(NaN) = 0.0. */
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
56 if (exp2l (zero / zero) == 0.0L)
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
57 result |= 1;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
58 /* This test fails on IRIX 6.5, where exp2l(-Inf) = 1.0. */
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
59 if (!(exp2l (-1.0L / zero) == 0.0L))
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
60 result |= 2;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
61 return result;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
62 }
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
63 ]])],
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
64 [gl_cv_func_exp2l_ieee=yes],
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
65 [gl_cv_func_exp2l_ieee=no],
16811
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
66 [case "$host_os" in
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
67 # Guess yes on glibc systems.
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
68 *-gnu*) gl_cv_func_exp2l_ieee="guessing yes" ;;
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
69 # 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: 16628
diff changeset
70 *) gl_cv_func_exp2l_ieee="guessing no" ;;
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
71 esac
b187fc49964b Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 16628
diff changeset
72 ])
16628
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
73 LIBS="$save_LIBS"
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
74 ])
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
75 case "$gl_cv_func_exp2l_ieee" in
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
76 *yes) ;;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
77 *) REPLACE_EXP2L=1 ;;
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
78 esac
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
79 fi
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
80 ])
16620
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 else
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 HAVE_EXP2L=0
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 HAVE_DECL_EXP2L=0
16628
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
84 fi
d19d163c1519 exp2l-ieee: Work around test failure on OpenBSD 4.9 and IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 16620
diff changeset
85 if test $HAVE_EXP2L = 0 || test $REPLACE_EXP2L = 1; then
16620
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 dnl Find libraries needed to link lib/exp2l.c.
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 EXP2L_LIBM="$EXP2_LIBM"
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 else
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 AC_REQUIRE([gl_FUNC_ISNANL])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 AC_REQUIRE([gl_FUNC_ROUNDL])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 AC_REQUIRE([gl_FUNC_LDEXPL])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 EXP2L_LIBM=
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 dnl Append $ISNANL_LIBM to EXP2L_LIBM, avoiding gratuitous duplicates.
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 case " $EXP2L_LIBM " in
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 *" $ISNANL_LIBM "*) ;;
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 *) EXP2L_LIBM="$EXP2L_LIBM $ISNANL_LIBM" ;;
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 esac
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 dnl Append $ROUNDL_LIBM to EXP2L_LIBM, avoiding gratuitous duplicates.
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 case " $EXP2L_LIBM " in
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 *" $ROUNDL_LIBM "*) ;;
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 *) EXP2L_LIBM="$EXP2L_LIBM $ROUNDL_LIBM" ;;
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 esac
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 dnl Append $LDEXPL_LIBM to EXP2L_LIBM, avoiding gratuitous duplicates.
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 case " $EXP2L_LIBM " in
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 *" $LDEXPL_LIBM "*) ;;
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107 *) EXP2L_LIBM="$EXP2L_LIBM $LDEXPL_LIBM" ;;
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 esac
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 fi
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 fi
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 AC_SUBST([EXP2L_LIBM])
4a578c3945b8 New module 'exp2l'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 ])