Mercurial > gnulib
annotate m4/sinl.m4 @ 40196:e63f5d3edab5
relocatable-prog: Update documentation.
* doc/relocatable-maint.texi (Supporting Relocation): Update to match
the recent changes.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 24 Feb 2019 01:49:15 +0100 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16397
diff
changeset
|
1 # sinl.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_SINL], |
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]) |
15939
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
10 AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) |
76734739cce2
sinl: 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 sinl(). |
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 SINL_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 sinl() 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_sinl_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> |
16397
3dd8fb89c3a4
sinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
25 long double (*funcptr) (long double) = sinl; |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
26 long double x;]], |
16397
3dd8fb89c3a4
sinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
27 [[return funcptr (x) > 0.4 |
3dd8fb89c3a4
sinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
28 || sinl (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_sinl_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_sinl_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_sinl_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 sinl() 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_sinl_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> |
16397
3dd8fb89c3a4
sinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
44 long double (*funcptr) (long double) = sinl; |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
45 long double x;]], |
16397
3dd8fb89c3a4
sinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
46 [[return funcptr (x) > 0.4 |
3dd8fb89c3a4
sinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
47 || sinl (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_sinl_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_sinl_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_sinl_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 SINL_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_sinl_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_sinl_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:
16397
diff
changeset
|
59 dnl Mac OS X 10.3 has sinl() 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:
15015
diff
changeset
|
60 AC_CHECK_DECL([sinl], , [HAVE_DECL_SINL=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_SINL=0 |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 HAVE_SINL=0 |
15015
674015319e54
sinl: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
64 dnl Find libraries needed to link lib/sinl.c, lib/sincosl.c, lib/trigl.c. |
15939
76734739cce2
sinl: 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 |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
66 AC_REQUIRE([gl_FUNC_SIN]) |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
67 SINL_LIBM="$SIN_LIBM" |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
68 else |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
69 AC_REQUIRE([gl_FUNC_ISNANL]) |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
70 AC_REQUIRE([gl_FUNC_FLOOR]) |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
71 AC_REQUIRE([gl_FUNC_FLOORL]) |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
72 dnl Append $ISNANL_LIBM to SINL_LIBM, avoiding gratuitous duplicates. |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
73 case " $SINL_LIBM " in |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
74 *" $ISNANL_LIBM "*) ;; |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
75 *) SINL_LIBM="$SINL_LIBM $ISNANL_LIBM" ;; |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
76 esac |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
77 dnl Append $FLOOR_LIBM to SINL_LIBM, avoiding gratuitous duplicates. |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
78 case " $SINL_LIBM " in |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
79 *" $FLOOR_LIBM "*) ;; |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
80 *) SINL_LIBM="$SINL_LIBM $FLOOR_LIBM" ;; |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
81 esac |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
82 dnl Append $FLOORL_LIBM to SINL_LIBM, avoiding gratuitous duplicates. |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
83 case " $SINL_LIBM " in |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
84 *" $FLOORL_LIBM "*) ;; |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
85 *) SINL_LIBM="$SINL_LIBM $FLOORL_LIBM" ;; |
76734739cce2
sinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
15617
diff
changeset
|
86 esac |
76734739cce2
sinl: 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([SINL_LIBM]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
90 ]) |