Mercurial > hg > octave-kai > gnulib-hg
annotate m4/asinl.m4 @ 15018:cdd6bc3177f7
asinl: Respect rules for use of AC_LIBOBJ.
* m4/asinl.m4 (gl_FUNC_ASINL): Move AC_LIBOBJ invocation from here...
* modules/asinl (configure.ac): ... to here.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 21 May 2011 11:52:29 +0200 |
parents | 97fc9a21a8fb |
children | a87db2cf4571 |
rev | line source |
---|---|
15018
cdd6bc3177f7
asinl: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
1 # asinl.m4 serial 4 |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
13578
diff
changeset
|
2 dnl Copyright (C) 2010-2011 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]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 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
|
11 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
|
12 |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 ASINL_LIBM= |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 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
|
15 [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
|
16 [ |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
17 AC_LINK_IFELSE( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
18 [AC_LANG_PROGRAM( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
19 [[#ifndef __NO_MATH_INLINES |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
20 # define __NO_MATH_INLINES 1 /* for glibc */ |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
21 #endif |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
22 #include <math.h> |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
23 long double x;]], |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
24 [[return asinl (x) > 1;]])], |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 [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
|
26 [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
|
27 ]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 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
|
29 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
|
30 [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
|
31 [ |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 save_LIBS="$LIBS" |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 LIBS="$LIBS -lm" |
13578
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
34 AC_LINK_IFELSE( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
35 [AC_LANG_PROGRAM( |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
36 [[#ifndef __NO_MATH_INLINES |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
37 # define __NO_MATH_INLINES 1 /* for glibc */ |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
38 #endif |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
39 #include <math.h> |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
40 long double x;]], |
1e26f884665f
Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents:
12765
diff
changeset
|
41 [[return asinl (x) > 1;]])], |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
42 [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
|
43 [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
|
44 LIBS="$save_LIBS" |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 ]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
46 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
|
47 ASINL_LIBM=-lm |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 fi |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
49 fi |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
50 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
|
51 || 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
|
52 dnl Also check whether it's declared. |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
53 dnl MacOS X 10.3 has asinl() in libc but doesn't declare it in <math.h>. |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
54 AC_CHECK_DECL([asinl], , [HAVE_DECL_ASINL=0], [#include <math.h>]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 else |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
56 HAVE_DECL_ASINL=0 |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 HAVE_ASINL=0 |
15018
cdd6bc3177f7
asinl: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
58 dnl Find libraries needed to link lib/asinl.c. |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
59 AC_REQUIRE([gl_FUNC_SQRTL]) |
12765 | 60 dnl Append $SQRTL_LIBM to ASINL_LIBM, avoiding gratuitous duplicates. |
61 case " $ASINL_LIBM " in | |
62 *" $SQRTL_LIBM "*) ;; | |
63 *) ASINL_LIBM="$ASINL_LIBM $SQRTL_LIBM" ;; | |
64 esac | |
12752
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
65 fi |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
66 AC_SUBST([ASINL_LIBM]) |
73d9dd27dc41
New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
67 ]) |