Mercurial > hg > octave-shane > gnulib-hg
annotate m4/expm1l.m4 @ 17480:f40b3156a43e
selinux-at: omit unnecessary include
* lib/selinux-at.c: Don't include dosname.h; not needed, since
this source file doesn't use its macros, and subsidiary files that
use the macros already include it.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Fri, 23 Aug 2013 13:53:46 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
16606
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
1 # expm1l.m4 serial 2 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16606
diff
changeset
|
2 dnl Copyright (C) 2010-2013 Free Software Foundation, Inc. |
16585 | 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_EXPM1L], | |
8 [ | |
9 AC_REQUIRE([gl_MATH_H_DEFAULTS]) | |
10 AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) | |
11 | |
12 dnl Persuade glibc <math.h> to declare expm1l(). | |
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | |
14 | |
15 EXPM1L_LIBM= | |
16 AC_CACHE_CHECK([whether expm1l() can be used without linking with libm], | |
17 [gl_cv_func_expm1l_no_libm], | |
18 [ | |
19 AC_LINK_IFELSE( | |
20 [AC_LANG_PROGRAM( | |
21 [[#ifndef __NO_MATH_INLINES | |
22 # define __NO_MATH_INLINES 1 /* for glibc */ | |
23 #endif | |
24 #include <math.h> | |
16606
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
25 extern |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
26 #ifdef __cplusplus |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
27 "C" |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
28 #endif |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
29 long double expm1l (long double); |
16585 | 30 long double (*funcptr) (long double) = expm1l; |
31 long double x;]], | |
32 [[return funcptr (x) > 0.5 | |
33 || expm1l (x) > 0.5;]])], | |
34 [gl_cv_func_expm1l_no_libm=yes], | |
35 [gl_cv_func_expm1l_no_libm=no]) | |
36 ]) | |
37 if test $gl_cv_func_expm1l_no_libm = no; then | |
38 AC_CACHE_CHECK([whether expm1l() can be used with libm], | |
39 [gl_cv_func_expm1l_in_libm], | |
40 [ | |
41 save_LIBS="$LIBS" | |
42 LIBS="$LIBS -lm" | |
43 AC_LINK_IFELSE( | |
44 [AC_LANG_PROGRAM( | |
45 [[#ifndef __NO_MATH_INLINES | |
46 # define __NO_MATH_INLINES 1 /* for glibc */ | |
47 #endif | |
48 #include <math.h> | |
16606
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
49 extern |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
50 #ifdef __cplusplus |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
51 "C" |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
52 #endif |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
53 long double expm1l (long double); |
16585 | 54 long double (*funcptr) (long double) = expm1l; |
55 long double x;]], | |
56 [[return funcptr (x) > 0.5 | |
57 || expm1l (x) > 0.5;]])], | |
58 [gl_cv_func_expm1l_in_libm=yes], | |
59 [gl_cv_func_expm1l_in_libm=no]) | |
60 LIBS="$save_LIBS" | |
61 ]) | |
62 if test $gl_cv_func_expm1l_in_libm = yes; then | |
63 EXPM1L_LIBM=-lm | |
64 fi | |
65 fi | |
16606
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
66 if test $gl_cv_func_expm1l_no_libm = yes \ |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
67 || test $gl_cv_func_expm1l_in_libm = yes; then |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
68 HAVE_EXPM1L=1 |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
69 dnl Also check whether it's declared. |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
70 dnl IRIX 6.5 has expm1l() in libm but doesn't declare it in <math.h>. |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
71 AC_CHECK_DECL([expm1l], , [HAVE_DECL_EXPM1L=0], [[#include <math.h>]]) |
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
72 else |
16585 | 73 HAVE_EXPM1L=0 |
16606
c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents:
16585
diff
changeset
|
74 HAVE_DECL_EXPM1L=0 |
16585 | 75 dnl Find libraries needed to link lib/expm1l.c. |
76 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then | |
77 AC_REQUIRE([gl_FUNC_EXPM1]) | |
78 EXPM1L_LIBM="$EXPM1_LIBM" | |
79 else | |
80 AC_REQUIRE([gl_FUNC_ISNANL]) | |
81 AC_REQUIRE([gl_FUNC_EXPL]) | |
82 AC_REQUIRE([gl_FUNC_ROUNDL]) | |
83 AC_REQUIRE([gl_FUNC_LDEXPL]) | |
84 EXPM1L_LIBM= | |
85 dnl Append $ISNANL_LIBM to EXPM1L_LIBM, avoiding gratuitous duplicates. | |
86 case " $EXPM1L_LIBM " in | |
87 *" $ISNANL_LIBM "*) ;; | |
88 *) EXPM1L_LIBM="$EXPM1L_LIBM $ISNANL_LIBM" ;; | |
89 esac | |
90 dnl Append $EXPL_LIBM to EXPM1L_LIBM, avoiding gratuitous duplicates. | |
91 case " $EXPM1L_LIBM " in | |
92 *" $EXPL_LIBM "*) ;; | |
93 *) EXPM1L_LIBM="$EXPM1L_LIBM $EXPL_LIBM" ;; | |
94 esac | |
95 dnl Append $ROUNDL_LIBM to EXPM1L_LIBM, avoiding gratuitous duplicates. | |
96 case " $EXPM1L_LIBM " in | |
97 *" $ROUNDL_LIBM "*) ;; | |
98 *) EXPM1L_LIBM="$EXPM1L_LIBM $ROUNDL_LIBM" ;; | |
99 esac | |
100 dnl Append $LDEXPL_LIBM to EXPM1L_LIBM, avoiding gratuitous duplicates. | |
101 case " $EXPM1L_LIBM " in | |
102 *" $LDEXPL_LIBM "*) ;; | |
103 *) EXPM1L_LIBM="$EXPM1L_LIBM $LDEXPL_LIBM" ;; | |
104 esac | |
105 fi | |
106 fi | |
107 AC_SUBST([EXPM1L_LIBM]) | |
108 ]) |