Mercurial > gnulib
annotate m4/tanl.m4 @ 40203:30d91797009f
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Fri, 01 Mar 2019 08:42:42 -0800 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16399
diff
changeset
|
1 # tanl.m4 serial 8 |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 dnl Copyright (C) 2010-2019 Free Software Foundation, Inc. |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 AC_DEFUN([gl_FUNC_TANL], |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 [ |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 AC_REQUIRE([gl_MATH_H_DEFAULTS]) |
15941
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
10 AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
11 |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 dnl Persuade glibc <math.h> to declare tanl(). |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 TANL_LIBM= |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 AC_CACHE_CHECK([whether tanl() can be used without linking with libm], |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 [gl_cv_func_tanl_no_libm], |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 [ |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
19 AC_LINK_IFELSE( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
20 [AC_LANG_PROGRAM( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
21 [[#ifndef __NO_MATH_INLINES |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
22 # define __NO_MATH_INLINES 1 /* for glibc */ |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
23 #endif |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
24 #include <math.h> |
16399
bffe229960ad
tanl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
25 long double (*funcptr) (long double) = tanl; |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
26 long double x;]], |
16399
bffe229960ad
tanl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
27 [[return funcptr (x) > 0.4 |
bffe229960ad
tanl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
28 || tanl (x) > 0.4;]])], |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 [gl_cv_func_tanl_no_libm=yes], |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 [gl_cv_func_tanl_no_libm=no]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 ]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 if test $gl_cv_func_tanl_no_libm = no; then |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 AC_CACHE_CHECK([whether tanl() can be used with libm], |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 [gl_cv_func_tanl_in_libm], |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 [ |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 save_LIBS="$LIBS" |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 LIBS="$LIBS -lm" |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
38 AC_LINK_IFELSE( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
39 [AC_LANG_PROGRAM( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
40 [[#ifndef __NO_MATH_INLINES |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
41 # define __NO_MATH_INLINES 1 /* for glibc */ |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
42 #endif |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
43 #include <math.h> |
16399
bffe229960ad
tanl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
44 long double (*funcptr) (long double) = tanl; |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
45 long double x;]], |
16399
bffe229960ad
tanl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
46 [[return funcptr (x) > 0.4 |
bffe229960ad
tanl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
47 || tanl (x) > 0.4;]])], |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 [gl_cv_func_tanl_in_libm=yes], |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
49 [gl_cv_func_tanl_in_libm=no]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
50 LIBS="$save_LIBS" |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
51 ]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 if test $gl_cv_func_tanl_in_libm = yes; then |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
53 TANL_LIBM=-lm |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
54 fi |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 fi |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
56 if test $gl_cv_func_tanl_no_libm = yes \ |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 || test $gl_cv_func_tanl_in_libm = yes; then |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
58 dnl Also check whether it's declared. |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16399
diff
changeset
|
59 dnl Mac OS X 10.3 has tanl() in libc but doesn't declare it in <math.h>. |
15617
a87db2cf4571
Properly quote AC_CHECK_DECL's 4th argument.
Bruno Haible <bruno@clisp.org>
parents:
15017
diff
changeset
|
60 AC_CHECK_DECL([tanl], , [HAVE_DECL_TANL=0], [[#include <math.h>]]) |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
61 else |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
62 HAVE_DECL_TANL=0 |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 HAVE_TANL=0 |
15017
87dac772c52e
tanl: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
64 dnl Find libraries needed to link lib/tanl.c, lib/trigl.c. |
15941
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
65 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
66 AC_REQUIRE([gl_FUNC_TAN]) |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
67 TANL_LIBM="$TAN_LIBM" |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
68 else |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
69 AC_REQUIRE([gl_FUNC_ISNANL]) |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
70 AC_REQUIRE([gl_FUNC_FLOOR]) |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
71 AC_REQUIRE([gl_FUNC_FLOORL]) |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
72 dnl Append $ISNANL_LIBM to TANL_LIBM, avoiding gratuitous duplicates. |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
73 case " $TANL_LIBM " in |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
74 *" $ISNANL_LIBM "*) ;; |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
75 *) TANL_LIBM="$TANL_LIBM $ISNANL_LIBM" ;; |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
76 esac |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
77 dnl Append $FLOOR_LIBM to TANL_LIBM, avoiding gratuitous duplicates. |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
78 case " $TANL_LIBM " in |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
79 *" $FLOOR_LIBM "*) ;; |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
80 *) TANL_LIBM="$TANL_LIBM $FLOOR_LIBM" ;; |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
81 esac |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
82 dnl Append $FLOORL_LIBM to TANL_LIBM, avoiding gratuitous duplicates. |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
83 case " $TANL_LIBM " in |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
84 *" $FLOORL_LIBM "*) ;; |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
85 *) TANL_LIBM="$TANL_LIBM $FLOORL_LIBM" ;; |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
86 esac |
83c276c24d2a
tanl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
87 fi |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
88 fi |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
89 AC_SUBST([TANL_LIBM]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
90 ]) |