annotate m4/expl.m4 @ 17440:0d0daceb5bdd

nproc: relax license to LGPLv2+ nproc merely exposes alternatives to sysconf(_SC_NPROCESSORS_CONF), which is part of glibc and thus LGPLv2+; it is not adding any value that strategically requires LGPLv3+. See also this thread. https://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00105.html * modules/nproc (License): Change from LGPLv3+. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 03 Jul 2013 15:34:30 -0600
parents e542fd46ad6f
children
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: 16576
diff changeset
1 # expl.m4 serial 8
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16935
diff changeset
2 dnl Copyright (C) 2010-2013 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_EXPL],
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])
15937
16cba28a5e86 expl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
10 AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
16cba28a5e86 expl: 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 expl().
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 EXPL_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 expl() 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_expl_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: 12752
diff changeset
19 AC_LINK_IFELSE(
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
20 [AC_LANG_PROGRAM(
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
21 [[#ifndef __NO_MATH_INLINES
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
22 # define __NO_MATH_INLINES 1 /* for glibc */
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
23 #endif
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
24 #include <math.h>
16395
68bd0cc2f6dd expl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
25 long double (*funcptr) (long double) = expl;
13578
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
26 long double x;]],
16395
68bd0cc2f6dd expl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
27 [[return funcptr (x) > 1.5
68bd0cc2f6dd expl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
28 || expl (x) > 1.5;]])],
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_expl_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_expl_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_expl_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 expl() 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_expl_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: 12752
diff changeset
38 AC_LINK_IFELSE(
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
39 [AC_LANG_PROGRAM(
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
40 [[#ifndef __NO_MATH_INLINES
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
41 # define __NO_MATH_INLINES 1 /* for glibc */
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
42 #endif
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
43 #include <math.h>
16395
68bd0cc2f6dd expl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
44 long double (*funcptr) (long double) = expl;
13578
1e26f884665f Modernize AC_TRY_LINK invocations.
Bruno Haible <bruno@clisp.org>
parents: 12752
diff changeset
45 long double x;]],
16395
68bd0cc2f6dd expl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
46 [[return funcptr (x) > 1.5
68bd0cc2f6dd expl: Provide function definition on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
47 || expl (x) > 1.5;]])],
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_expl_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_expl_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_expl_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 EXPL_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_expl_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_expl_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: 16576
diff changeset
59 dnl Mac OS X 10.3 has expl() 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: 15013
diff changeset
60 AC_CHECK_DECL([expl], , [HAVE_DECL_EXPL=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_EXPL=0
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 HAVE_EXPL=0
15013
8836800a98a0 expl: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
64 dnl Find libraries needed to link lib/expl.c.
15937
16cba28a5e86 expl: 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
16cba28a5e86 expl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
66 AC_REQUIRE([gl_FUNC_EXP])
16cba28a5e86 expl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
67 EXPL_LIBM="$EXP_LIBM"
16cba28a5e86 expl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
68 else
16576
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
69 AC_REQUIRE([gl_FUNC_ISNANL])
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
70 AC_REQUIRE([gl_FUNC_ROUNDL])
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
71 AC_REQUIRE([gl_FUNC_LDEXPL])
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
72 EXPL_LIBM=
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
73 dnl Append $ISNANL_LIBM to EXPL_LIBM, avoiding gratuitous duplicates.
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
74 case " $EXPL_LIBM " in
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
75 *" $ISNANL_LIBM "*) ;;
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
76 *) EXPL_LIBM="$EXPL_LIBM $ISNANL_LIBM" ;;
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
77 esac
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
78 dnl Append $ROUNDL_LIBM to EXPL_LIBM, avoiding gratuitous duplicates.
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
79 case " $EXPL_LIBM " in
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
80 *" $ROUNDL_LIBM "*) ;;
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
81 *) EXPL_LIBM="$EXPL_LIBM $ROUNDL_LIBM" ;;
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
82 esac
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
83 dnl Append $LDEXPL_LIBM to EXPL_LIBM, avoiding gratuitous duplicates.
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
84 case " $EXPL_LIBM " in
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
85 *" $LDEXPL_LIBM "*) ;;
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
86 *) EXPL_LIBM="$EXPL_LIBM $LDEXPL_LIBM" ;;
6c7c671909d3 expl: Fix precision of computed result.
Bruno Haible <bruno@clisp.org>
parents: 16395
diff changeset
87 esac
15937
16cba28a5e86 expl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents: 15617
diff changeset
88 fi
12752
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 fi
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 AC_SUBST([EXPL_LIBM])
73d9dd27dc41 New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 ])