annotate m4/asinl.m4 @ 17040:2b2ed538a898

update from texinfo
author Karl Berry <karl@freefriends.org>
date Mon, 13 Aug 2012 15:48:24 -0700
parents 498a2211d839
children e542fd46ad6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16935
498a2211d839 Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 16400
diff changeset
1 # asinl.m4 serial 8
16201
8250f2777afc maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents: 15942
diff changeset
2 dnl Copyright (C) 2010-2012 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_ASINL],
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])
15942
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
10 AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
cfc88a2774f7 asinl: 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 asinl().
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 ASINL_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 asinl() 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_asinl_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>
16400
7f26a7ed91f4 asinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
25 long double (*funcptr) (long double) = asinl;
13578
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12765
diff changeset
26 long double x;]],
16400
7f26a7ed91f4 asinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
27 [[return funcptr (x) > 1
7f26a7ed91f4 asinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
28 || asinl (x) > 1;]])],
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_asinl_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_asinl_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_asinl_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 asinl() 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_asinl_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>
16400
7f26a7ed91f4 asinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
44 long double (*funcptr) (long double) = asinl;
13578
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12765
diff changeset
45 long double x;]],
16400
7f26a7ed91f4 asinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
46 [[return funcptr (x) > 1
7f26a7ed91f4 asinl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
47 || asinl (x) > 1;]])],
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_asinl_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_asinl_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_asinl_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 ASINL_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_asinl_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_asinl_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: 16400
diff changeset
59 dnl Mac OS X 10.3 has asinl() 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: 15018
diff changeset
60 AC_CHECK_DECL([asinl], , [HAVE_DECL_ASINL=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_ASINL=0
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 HAVE_ASINL=0
15018
cdd6bc3177f7 asinl: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
64 dnl Find libraries needed to link lib/asinl.c.
15942
cfc88a2774f7 asinl: 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
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
66 AC_REQUIRE([gl_FUNC_ASIN])
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
67 ASINL_LIBM="$ASIN_LIBM"
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
68 else
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
69 AC_REQUIRE([gl_FUNC_SQRTL])
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
70 dnl Append $SQRTL_LIBM to ASINL_LIBM, avoiding gratuitous duplicates.
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
71 case " $ASINL_LIBM " in
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
72 *" $SQRTL_LIBM "*) ;;
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
73 *) ASINL_LIBM="$ASINL_LIBM $SQRTL_LIBM" ;;
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
74 esac
cfc88a2774f7 asinl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
75 fi
12752
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 fi
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 AC_SUBST([ASINL_LIBM])
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 ])