summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog47
-rw-r--r--doc/posix-functions/acosl.texi11
-rw-r--r--doc/posix-functions/asinl.texi11
-rw-r--r--doc/posix-functions/atanl.texi11
-rw-r--r--doc/posix-functions/cosl.texi11
-rw-r--r--doc/posix-functions/expl.texi11
-rw-r--r--doc/posix-functions/logl.texi11
-rw-r--r--doc/posix-functions/sinl.texi11
-rw-r--r--doc/posix-functions/sqrtl.texi11
-rw-r--r--doc/posix-functions/tanl.texi11
-rw-r--r--lib/cosl.c4
-rw-r--r--lib/math.in.h78
-rw-r--r--lib/sincosl.c5
-rw-r--r--lib/sinl.c2
-rw-r--r--lib/tanl.c7
-rw-r--r--lib/trigl.c5
-rw-r--r--m4/acosl.m460
-rw-r--r--m4/asinl.m459
-rw-r--r--m4/atanl.m459
-rw-r--r--m4/cosl.m463
-rw-r--r--m4/expl.m459
-rw-r--r--m4/logl.m461
-rw-r--r--m4/math_h.m421
-rw-r--r--m4/mathl.m413
-rw-r--r--m4/sinl.m463
-rw-r--r--m4/sqrtl.m462
-rw-r--r--m4/tanl.m462
-rw-r--r--modules/acosl30
-rw-r--r--modules/asinl29
-rw-r--r--modules/atanl29
-rw-r--r--modules/cosl35
-rw-r--r--modules/expl30
-rw-r--r--modules/logl31
-rw-r--r--modules/math19
-rw-r--r--modules/mathl42
-rw-r--r--modules/sinl35
-rw-r--r--modules/sqrtl33
-rw-r--r--modules/tanl34
38 files changed, 1057 insertions, 119 deletions
diff --git a/ChangeLog b/ChangeLog
index 25bbbe5aab..c841c7c555 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,52 @@
2010-01-18 Bruno Haible <bruno@clisp.org>
+ New modules acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
+ * lib/math.in.h (acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl,
+ tanl): Use the standard gnulib idiom.
+ * lib/cosl.c: Don't include trigl.c and sincosl.c.
+ * lib/sinl.c: Likewise.
+ * lib/tanl.c: Don't include trigl.c.
+ (kernel_tanl): Make static.
+ * lib/sincosl.c: Include trig.h first.
+ * lib/trigl.c: Likewise.
+ * m4/acosl.m4: New file.
+ * m4/asinl.m4: New file.
+ * m4/atanl.m4: New file.
+ * m4/cosl.m4: New file.
+ * m4/expl.m4: New file.
+ * m4/logl.m4: New file.
+ * m4/sinl.m4: New file.
+ * m4/sqrtl.m4: New file.
+ * m4/tanl.m4: New file.
+ * m4/mathl.m4: Remove file.
+ * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize GNULIB_* and HAVE_*
+ variables for acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl.
+ Don't initialize GNULIB_MATHL.
+ * modules/acosl: New file.
+ * modules/asinl: New file.
+ * modules/atanl: New file.
+ * modules/cosl: New file.
+ * modules/expl: New file.
+ * modules/logl: New file.
+ * modules/sinl: New file.
+ * modules/sqrtl: New file.
+ * modules/tanl: New file.
+ * modules/math (Makefile.am): Substitute GNULIB_* and HAVE_* variables
+ for acosl, asinl, atanl, cosl, expl, logl, sinl, sqrtl, tanl. Don't
+ substitute GNULIB_MATHL.
+ * modules/mathl: Rewritten.
+ * doc/posix-functions/acosl.texi: Mention the 'acosl' module.
+ * doc/posix-functions/asinl.texi: Mention the 'asinl' module.
+ * doc/posix-functions/atanl.texi: Mention the 'atanl' module.
+ * doc/posix-functions/cosl.texi: Mention the 'cosl' module.
+ * doc/posix-functions/expl.texi: Mention the 'expl' module.
+ * doc/posix-functions/logl.texi: Mention the 'logl' module.
+ * doc/posix-functions/sinl.texi: Mention the 'sinl' module.
+ * doc/posix-functions/sqrtl.texi: Mention the 'sqrtl' module.
+ * doc/posix-functions/tanl.texi: Mention the 'tanl' module.
+
+2010-01-18 Bruno Haible <bruno@clisp.org>
+
sqrt: Make gl_FUNC_SQRT requirable.
* m4/sqrt.m4: New file.
* modules/sqrt (Files): Add it.
diff --git a/doc/posix-functions/acosl.texi b/doc/posix-functions/acosl.texi
index 48ed97926a..99e4f78c32 100644
--- a/doc/posix-functions/acosl.texi
+++ b/doc/posix-functions/acosl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/acosl.html}
-Gnulib module: ---
+Gnulib module: acosl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/asinl.texi b/doc/posix-functions/asinl.texi
index 11587ac726..c30445088d 100644
--- a/doc/posix-functions/asinl.texi
+++ b/doc/posix-functions/asinl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/asinl.html}
-Gnulib module: ---
+Gnulib module: asinl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/atanl.texi b/doc/posix-functions/atanl.texi
index 638e2597ed..971c5be6b4 100644
--- a/doc/posix-functions/atanl.texi
+++ b/doc/posix-functions/atanl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/atanl.html}
-Gnulib module: ---
+Gnulib module: atanl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/cosl.texi b/doc/posix-functions/cosl.texi
index a23821dd68..d46bbb3a9d 100644
--- a/doc/posix-functions/cosl.texi
+++ b/doc/posix-functions/cosl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/cosl.html}
-Gnulib module: ---
+Gnulib module: cosl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/expl.texi b/doc/posix-functions/expl.texi
index fc67ddde90..23b7bbf936 100644
--- a/doc/posix-functions/expl.texi
+++ b/doc/posix-functions/expl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/expl.html}
-Gnulib module: ---
+Gnulib module: expl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/logl.texi b/doc/posix-functions/logl.texi
index f325c3a32e..3df7d97068 100644
--- a/doc/posix-functions/logl.texi
+++ b/doc/posix-functions/logl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/logl.html}
-Gnulib module: ---
+Gnulib module: logl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/sinl.texi b/doc/posix-functions/sinl.texi
index 06ca60524d..30751c21c3 100644
--- a/doc/posix-functions/sinl.texi
+++ b/doc/posix-functions/sinl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/sinl.html}
-Gnulib module: ---
+Gnulib module: sinl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/sqrtl.texi b/doc/posix-functions/sqrtl.texi
index 8657f5222b..c91fa082dc 100644
--- a/doc/posix-functions/sqrtl.texi
+++ b/doc/posix-functions/sqrtl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/sqrtl.html}
-Gnulib module: ---
+Gnulib module: sqrtl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/doc/posix-functions/tanl.texi b/doc/posix-functions/tanl.texi
index 8e094475ac..109a598f29 100644
--- a/doc/posix-functions/tanl.texi
+++ b/doc/posix-functions/tanl.texi
@@ -4,15 +4,18 @@
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/tanl.html}
-Gnulib module: ---
+Gnulib module: tanl
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
+@item
+This function is not declared on some platforms:
+MacOS X 10.3.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, Interix 3.5, BeOS.
@end itemize
diff --git a/lib/cosl.c b/lib/cosl.c
index 53df794a1e..884cec8c66 100644
--- a/lib/cosl.c
+++ b/lib/cosl.c
@@ -50,10 +50,6 @@
*/
#include "trigl.h"
-#ifdef HAVE_SINL
-#include "trigl.c"
-#include "sincosl.c"
-#endif
long double cosl(long double x)
{
diff --git a/lib/math.in.h b/lib/math.in.h
index 7f0942431b..4e21cf95cb 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -118,10 +118,11 @@ extern double frexp (double x, int *expptr) _GL_ARG_NONNULL ((2));
#endif
-#if @GNULIB_MATHL@ || !@HAVE_DECL_ACOSL@
+#if @GNULIB_ACOSL@
+# if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
extern long double acosl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef acosl
# define acosl(x) \
(GL_LINK_WARNING ("acosl is unportable - " \
@@ -130,10 +131,11 @@ extern long double acosl (long double x);
#endif
-#if @GNULIB_MATHL@ || !@HAVE_DECL_ASINL@
+#if @GNULIB_ASINL@
+# if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
extern long double asinl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef asinl
# define asinl(x) \
(GL_LINK_WARNING ("asinl is unportable - " \
@@ -142,10 +144,11 @@ extern long double asinl (long double x);
#endif
-#if @GNULIB_MATHL@ || !@HAVE_DECL_ATANL@
+#if @GNULIB_ATANL@
+# if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
extern long double atanl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef atanl
# define atanl(x) \
(GL_LINK_WARNING ("atanl is unportable - " \
@@ -181,11 +184,15 @@ extern long double ceill (long double x);
#endif
-#if @GNULIB_MATHL@ || (!@HAVE_DECL_COSL@ && !defined cosl)
-# undef cosl
+#if @GNULIB_COSL@
+# if !@HAVE_COSL@
+# undef cosl
+# define cosl rpl_cosl
+# endif
+# if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
extern long double cosl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef cosl
# define cosl(x) \
(GL_LINK_WARNING ("cosl is unportable - " \
@@ -194,10 +201,11 @@ extern long double cosl (long double x);
#endif
-#if @GNULIB_MATHL@ || !@HAVE_DECL_EXPL@
+#if @GNULIB_EXPL@
+# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
extern long double expl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef expl
# define expl(x) \
(GL_LINK_WARNING ("expl is unportable - " \
@@ -271,11 +279,15 @@ extern long double ldexpl (long double x, int exp);
#endif
-#if @GNULIB_MATHL@ || (!@HAVE_DECL_LOGL@ && !defined logl)
-# undef logl
+#if @GNULIB_LOGL@
+# if !@HAVE_LOGL@
+# undef logl
+# define logl rpl_logl
+# endif
+# if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
extern long double logl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef logl
# define logl(x) \
(GL_LINK_WARNING ("logl is unportable - " \
@@ -327,11 +339,15 @@ extern long double roundl (long double x);
#endif
-#if @GNULIB_MATHL@ || (!@HAVE_DECL_SINL@ && !defined sinl)
-# undef sinl
+#if @GNULIB_SINL@
+# if !@HAVE_SINL@
+# undef sinl
+# define sinl rpl_sinl
+# endif
+# if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
extern long double sinl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef sinl
# define sinl(x) \
(GL_LINK_WARNING ("sinl is unportable - " \
@@ -340,10 +356,11 @@ extern long double sinl (long double x);
#endif
-#if @GNULIB_MATHL@ || !@HAVE_DECL_SQRTL@
+#if @GNULIB_SQRTL@
+# if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
extern long double sqrtl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef sqrtl
# define sqrtl(x) \
(GL_LINK_WARNING ("sqrtl is unportable - " \
@@ -352,10 +369,11 @@ extern long double sqrtl (long double x);
#endif
-#if @GNULIB_MATHL@ || !@HAVE_DECL_TANL@
+#if @GNULIB_TANL@
+# if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
extern long double tanl (long double x);
-#endif
-#if !@GNULIB_MATHL@ && defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
# undef tanl
# define tanl(x) \
(GL_LINK_WARNING ("tanl is unportable - " \
diff --git a/lib/sincosl.c b/lib/sincosl.c
index 2c7ba93b9f..9fae568ae7 100644
--- a/lib/sincosl.c
+++ b/lib/sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point trigonometric functions on <-pi/4,pi/4>.
- Copyright (C) 1999, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2006, 2007, 2009-2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -19,9 +19,10 @@
#include <config.h>
/* Specification. */
-#include <math.h>
+#include "trigl.h"
#include <float.h>
+#include <math.h>
static const long double sin_c[] = {
#define ONE sin_c[0]
diff --git a/lib/sinl.c b/lib/sinl.c
index eb0e05b6ec..d8a0e7a1be 100644
--- a/lib/sinl.c
+++ b/lib/sinl.c
@@ -50,8 +50,6 @@
*/
#include "trigl.h"
-#include "trigl.c"
-#include "sincosl.c"
long double
sinl (long double x)
diff --git a/lib/tanl.c b/lib/tanl.c
index 51262f0d85..6a6dc6d858 100644
--- a/lib/tanl.c
+++ b/lib/tanl.c
@@ -50,11 +50,6 @@
*/
#include "trigl.h"
-#ifdef HAVE_SINL
-#ifdef HAVE_COSL
-#include "trigl.c"
-#endif
-#endif
/*
* ====================================================
@@ -120,7 +115,7 @@ static const long double
/* 1.000000000000000000000000000000000000000E0 */
-long double
+static long double
kernel_tanl (long double x, long double y, int iy)
{
long double z, r, v, w, s, u, u1;
diff --git a/lib/trigl.c b/lib/trigl.c
index 1a8a7913ef..fbd4815d4c 100644
--- a/lib/trigl.c
+++ b/lib/trigl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point argument reduction.
- Copyright (C) 1999, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2007, 2009-2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -19,9 +19,10 @@
#include <config.h>
/* Specification. */
-#include <math.h>
+#include "trigl.h"
#include <float.h>
+#include <math.h>
/* Table of constants for 2/pi, 5628 hexadecimal digits of 2/pi */
static const int two_over_pi[] = {
diff --git a/m4/acosl.m4 b/m4/acosl.m4
new file mode 100644
index 0000000000..0e57df5b25
--- /dev/null
+++ b/m4/acosl.m4
@@ -0,0 +1,60 @@
+# acosl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ACOSL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare acosl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ ACOSL_LIBM=
+ AC_CACHE_CHECK([whether acosl() can be used without linking with libm],
+ [gl_cv_func_acosl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return acosl (x) > 1;],
+ [gl_cv_func_acosl_no_libm=yes],
+ [gl_cv_func_acosl_no_libm=no])
+ ])
+ if test $gl_cv_func_acosl_no_libm = no; then
+ AC_CACHE_CHECK([whether acosl() can be used with libm],
+ [gl_cv_func_acosl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return acosl (x) > 1;],
+ [gl_cv_func_acosl_in_libm=yes],
+ [gl_cv_func_acosl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_acosl_in_libm = yes; then
+ ACOSL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_acosl_no_libm = yes \
+ || test $gl_cv_func_acosl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has acosl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([acosl], , [HAVE_DECL_ACOSL=0], [#include <math.h>])
+ else
+ HAVE_DECL_ACOSL=0
+ HAVE_ACOSL=0
+ AC_LIBOBJ([acosl])
+ AC_REQUIRE([gl_FUNC_ASINL])
+ AC_REQUIRE([gl_FUNC_SQRTL])
+ ACOSL_LIBM="$ASINL_LIBM $SQRTL_LIBM"
+ fi
+ AC_SUBST([ACOSL_LIBM])
+])
diff --git a/m4/asinl.m4 b/m4/asinl.m4
new file mode 100644
index 0000000000..f2281a2327
--- /dev/null
+++ b/m4/asinl.m4
@@ -0,0 +1,59 @@
+# asinl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ASINL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare asinl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ ASINL_LIBM=
+ AC_CACHE_CHECK([whether asinl() can be used without linking with libm],
+ [gl_cv_func_asinl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return asinl (x) > 1;],
+ [gl_cv_func_asinl_no_libm=yes],
+ [gl_cv_func_asinl_no_libm=no])
+ ])
+ if test $gl_cv_func_asinl_no_libm = no; then
+ AC_CACHE_CHECK([whether asinl() can be used with libm],
+ [gl_cv_func_asinl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return asinl (x) > 1;],
+ [gl_cv_func_asinl_in_libm=yes],
+ [gl_cv_func_asinl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_asinl_in_libm = yes; then
+ ASINL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_asinl_no_libm = yes \
+ || test $gl_cv_func_asinl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has asinl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([asinl], , [HAVE_DECL_ASINL=0], [#include <math.h>])
+ else
+ HAVE_DECL_ASINL=0
+ HAVE_ASINL=0
+ AC_LIBOBJ([asinl])
+ AC_REQUIRE([gl_FUNC_SQRTL])
+ ASINL_LIBM="$SQRTL_LIBM"
+ fi
+ AC_SUBST([ASINL_LIBM])
+])
diff --git a/m4/atanl.m4 b/m4/atanl.m4
new file mode 100644
index 0000000000..507f22b8ba
--- /dev/null
+++ b/m4/atanl.m4
@@ -0,0 +1,59 @@
+# atanl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ATANL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare atanl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ ATANL_LIBM=
+ AC_CACHE_CHECK([whether atanl() can be used without linking with libm],
+ [gl_cv_func_atanl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return atanl (x) > 1;],
+ [gl_cv_func_atanl_no_libm=yes],
+ [gl_cv_func_atanl_no_libm=no])
+ ])
+ if test $gl_cv_func_atanl_no_libm = no; then
+ AC_CACHE_CHECK([whether atanl() can be used with libm],
+ [gl_cv_func_atanl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return atanl (x) > 1;],
+ [gl_cv_func_atanl_in_libm=yes],
+ [gl_cv_func_atanl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_atanl_in_libm = yes; then
+ ATANL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_atanl_no_libm = yes \
+ || test $gl_cv_func_atanl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has atanl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([atanl], , [HAVE_DECL_ATANL=0], [#include <math.h>])
+ else
+ HAVE_DECL_ATANL=0
+ HAVE_ATANL=0
+ AC_LIBOBJ([atanl])
+ AC_REQUIRE([gl_FUNC_ISNANL])
+ ATANL_LIBM="$ISNANL_LIBM"
+ fi
+ AC_SUBST([ATANL_LIBM])
+])
diff --git a/m4/cosl.m4 b/m4/cosl.m4
new file mode 100644
index 0000000000..460d0f0024
--- /dev/null
+++ b/m4/cosl.m4
@@ -0,0 +1,63 @@
+# cosl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_COSL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare cosl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ COSL_LIBM=
+ AC_CACHE_CHECK([whether cosl() can be used without linking with libm],
+ [gl_cv_func_cosl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return cosl (x) > 0.4;],
+ [gl_cv_func_cosl_no_libm=yes],
+ [gl_cv_func_cosl_no_libm=no])
+ ])
+ if test $gl_cv_func_cosl_no_libm = no; then
+ AC_CACHE_CHECK([whether cosl() can be used with libm],
+ [gl_cv_func_cosl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return cosl (x) > 0.4;],
+ [gl_cv_func_cosl_in_libm=yes],
+ [gl_cv_func_cosl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_cosl_in_libm = yes; then
+ COSL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_cosl_no_libm = yes \
+ || test $gl_cv_func_cosl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has cosl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([cosl], , [HAVE_DECL_COSL=0], [#include <math.h>])
+ else
+ HAVE_DECL_COSL=0
+ HAVE_COSL=0
+ AC_LIBOBJ([cosl])
+ AC_LIBOBJ([sincosl])
+ AC_LIBOBJ([trigl])
+ AC_REQUIRE([gl_FUNC_ISNANL])
+ AC_REQUIRE([gl_FUNC_FLOOR])
+ AC_REQUIRE([gl_FUNC_FLOORL])
+ COSL_LIBM="$ISNANL_LIBM $FLOOR_LIBM $FLOORL_LIBM"
+ fi
+ AC_SUBST([COSL_LIBM])
+])
diff --git a/m4/expl.m4 b/m4/expl.m4
new file mode 100644
index 0000000000..698a9fb8ad
--- /dev/null
+++ b/m4/expl.m4
@@ -0,0 +1,59 @@
+# expl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_EXPL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare expl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ EXPL_LIBM=
+ AC_CACHE_CHECK([whether expl() can be used without linking with libm],
+ [gl_cv_func_expl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return expl (x) > 1.5;],
+ [gl_cv_func_expl_no_libm=yes],
+ [gl_cv_func_expl_no_libm=no])
+ ])
+ if test $gl_cv_func_expl_no_libm = no; then
+ AC_CACHE_CHECK([whether expl() can be used with libm],
+ [gl_cv_func_expl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return expl (x) > 1.5;],
+ [gl_cv_func_expl_in_libm=yes],
+ [gl_cv_func_expl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_expl_in_libm = yes; then
+ EXPL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_expl_no_libm = yes \
+ || test $gl_cv_func_expl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has expl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([expl], , [HAVE_DECL_EXPL=0], [#include <math.h>])
+ else
+ HAVE_DECL_EXPL=0
+ HAVE_EXPL=0
+ AC_LIBOBJ([expl])
+ AC_REQUIRE([gl_FUNC_FLOORL])
+ EXPL_LIBM="$FLOORL_LIBM"
+ fi
+ AC_SUBST([EXPL_LIBM])
+])
diff --git a/m4/logl.m4 b/m4/logl.m4
new file mode 100644
index 0000000000..196dcbdaa1
--- /dev/null
+++ b/m4/logl.m4
@@ -0,0 +1,61 @@
+# logl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_LOGL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare logl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ LOGL_LIBM=
+ AC_CACHE_CHECK([whether logl() can be used without linking with libm],
+ [gl_cv_func_logl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return logl (x) > 1;],
+ [gl_cv_func_logl_no_libm=yes],
+ [gl_cv_func_logl_no_libm=no])
+ ])
+ if test $gl_cv_func_logl_no_libm = no; then
+ AC_CACHE_CHECK([whether logl() can be used with libm],
+ [gl_cv_func_logl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return logl (x) > 1;],
+ [gl_cv_func_logl_in_libm=yes],
+ [gl_cv_func_logl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_logl_in_libm = yes; then
+ LOGL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_logl_no_libm = yes \
+ || test $gl_cv_func_logl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has logl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([logl], , [HAVE_DECL_LOGL=0], [#include <math.h>])
+ else
+ HAVE_DECL_LOGL=0
+ HAVE_LOGL=0
+ AC_LIBOBJ([logl])
+ AC_REQUIRE([gl_FUNC_FREXPL])
+ AC_REQUIRE([gl_FUNC_ISNANL])
+ AC_REQUIRE([gl_FUNC_FLOORL])
+ LOGL_LIBM="$FREXPL_LIBM $ISNANL_LIBM $FLOORL_LIBM"
+ fi
+ AC_SUBST([LOGL_LIBM])
+])
diff --git a/m4/math_h.m4 b/m4/math_h.m4
index bd8128b0c9..1e4c4803c7 100644
--- a/m4/math_h.m4
+++ b/m4/math_h.m4
@@ -1,4 +1,4 @@
-# math_h.m4 serial 15
+# math_h.m4 serial 16
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -46,8 +46,13 @@ AC_DEFUN([gl_MATH_MODULE_INDICATOR],
AC_DEFUN([gl_MATH_H_DEFAULTS],
[
+ GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL])
+ GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL])
+ GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL])
GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF])
GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL])
+ GNULIB_COSL=0; AC_SUBST([GNULIB_COSL])
+ GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL])
GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF])
GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL])
GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
@@ -59,18 +64,30 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND])
GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL])
GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
- GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL])
+ GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL])
GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND])
GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF])
GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL])
GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT])
+ GNULIB_SINL=0; AC_SUBST([GNULIB_SINL])
+ GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL])
+ GNULIB_TANL=0; AC_SUBST([GNULIB_TANL])
GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC])
GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
+ HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
+ HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
+ HAVE_COSL=1; AC_SUBST([HAVE_COSL])
+ HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
+ HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
+ HAVE_SINL=1; AC_SUBST([HAVE_SINL])
+ HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
+ HAVE_TANL=1; AC_SUBST([HAVE_TANL])
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
diff --git a/m4/mathl.m4 b/m4/mathl.m4
deleted file mode 100644
index cfe2de0bcb..0000000000
--- a/m4/mathl.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-# mathl.m4 serial 5
-dnl Copyright (c) 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_LONG_DOUBLE_MATH], [
-
-AC_CHECK_LIB([m], [atan])
-AC_REPLACE_FUNCS(floorl ceill sqrtl asinl acosl atanl \
- logl expl tanl sinl cosl)
-
-])
diff --git a/m4/sinl.m4 b/m4/sinl.m4
new file mode 100644
index 0000000000..12393264b6
--- /dev/null
+++ b/m4/sinl.m4
@@ -0,0 +1,63 @@
+# sinl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SINL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare sinl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ SINL_LIBM=
+ AC_CACHE_CHECK([whether sinl() can be used without linking with libm],
+ [gl_cv_func_sinl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return sinl (x) > 0.4;],
+ [gl_cv_func_sinl_no_libm=yes],
+ [gl_cv_func_sinl_no_libm=no])
+ ])
+ if test $gl_cv_func_sinl_no_libm = no; then
+ AC_CACHE_CHECK([whether sinl() can be used with libm],
+ [gl_cv_func_sinl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return sinl (x) > 0.4;],
+ [gl_cv_func_sinl_in_libm=yes],
+ [gl_cv_func_sinl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_sinl_in_libm = yes; then
+ SINL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_sinl_no_libm = yes \
+ || test $gl_cv_func_sinl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has sinl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([sinl], , [HAVE_DECL_SINL=0], [#include <math.h>])
+ else
+ HAVE_DECL_SINL=0
+ HAVE_SINL=0
+ AC_LIBOBJ([sinl])
+ AC_LIBOBJ([sincosl])
+ AC_LIBOBJ([trigl])
+ AC_REQUIRE([gl_FUNC_ISNANL])
+ AC_REQUIRE([gl_FUNC_FLOOR])
+ AC_REQUIRE([gl_FUNC_FLOORL])
+ SINL_LIBM="$ISNANL_LIBM $FLOOR_LIBM $FLOORL_LIBM"
+ fi
+ AC_SUBST([SINL_LIBM])
+])
diff --git a/m4/sqrtl.m4 b/m4/sqrtl.m4
new file mode 100644
index 0000000000..7a29f9ad4f
--- /dev/null
+++ b/m4/sqrtl.m4
@@ -0,0 +1,62 @@
+# sqrtl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SQRTL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare sqrtl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ SQRTL_LIBM=
+ AC_CACHE_CHECK([whether sqrtl() can be used without linking with libm],
+ [gl_cv_func_sqrtl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return sqrtl (x) > 0.4;],
+ [gl_cv_func_sqrtl_no_libm=yes],
+ [gl_cv_func_sqrtl_no_libm=no])
+ ])
+ if test $gl_cv_func_sqrtl_no_libm = no; then
+ AC_CACHE_CHECK([whether sqrtl() can be used with libm],
+ [gl_cv_func_sqrtl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return sqrtl (x) > 0.4;],
+ [gl_cv_func_sqrtl_in_libm=yes],
+ [gl_cv_func_sqrtl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_sqrtl_in_libm = yes; then
+ SQRTL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_sqrtl_no_libm = yes \
+ || test $gl_cv_func_sqrtl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has sqrtl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([sqrtl], , [HAVE_DECL_SQRTL=0], [#include <math.h>])
+ else
+ HAVE_DECL_SQRTL=0
+ HAVE_SQRTL=0
+ AC_LIBOBJ([sqrtl])
+ AC_REQUIRE([gl_FUNC_ISNANL])
+ AC_REQUIRE([gl_FUNC_FREXPL])
+ AC_REQUIRE([gl_FUNC_LDEXPL])
+ AC_REQUIRE([gl_FUNC_SQRT])
+ SQRTL_LIBM="$ISNANL_LIBM $FREXPL_LIBM $LDEXPL_LIBM $SQRT_LIBM"
+ fi
+ AC_SUBST([SQRTL_LIBM])
+])
diff --git a/m4/tanl.m4 b/m4/tanl.m4
new file mode 100644
index 0000000000..8f4ee101ab
--- /dev/null
+++ b/m4/tanl.m4
@@ -0,0 +1,62 @@
+# tanl.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_TANL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare tanl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ TANL_LIBM=
+ AC_CACHE_CHECK([whether tanl() can be used without linking with libm],
+ [gl_cv_func_tanl_no_libm],
+ [
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return tanl (x) > 0.4;],
+ [gl_cv_func_tanl_no_libm=yes],
+ [gl_cv_func_tanl_no_libm=no])
+ ])
+ if test $gl_cv_func_tanl_no_libm = no; then
+ AC_CACHE_CHECK([whether tanl() can be used with libm],
+ [gl_cv_func_tanl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ long double x;],
+ [return tanl (x) > 0.4;],
+ [gl_cv_func_tanl_in_libm=yes],
+ [gl_cv_func_tanl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_tanl_in_libm = yes; then
+ TANL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_tanl_no_libm = yes \
+ || test $gl_cv_func_tanl_in_libm = yes; then
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has tanl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([tanl], , [HAVE_DECL_TANL=0], [#include <math.h>])
+ else
+ HAVE_DECL_TANL=0
+ HAVE_TANL=0
+ AC_LIBOBJ([tanl])
+ AC_LIBOBJ([trigl])
+ AC_REQUIRE([gl_FUNC_ISNANL])
+ AC_REQUIRE([gl_FUNC_FLOOR])
+ AC_REQUIRE([gl_FUNC_FLOORL])
+ TANL_LIBM="$ISNANL_LIBM $FLOOR_LIBM $FLOORL_LIBM"
+ fi
+ AC_SUBST([TANL_LIBM])
+])
diff --git a/modules/acosl b/modules/acosl
new file mode 100644
index 0000000000..3c49196f35
--- /dev/null
+++ b/modules/acosl
@@ -0,0 +1,30 @@
+Description:
+acosl() function: inverse cosine function with long double argument.
+
+Files:
+lib/acosl.c
+m4/acosl.m4
+
+Depends-on:
+math
+extensions
+asinl
+sqrtl
+
+configure.ac:
+gl_FUNC_ACOSL
+gl_MATH_MODULE_INDICATOR([acosl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ACOSL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/asinl b/modules/asinl
new file mode 100644
index 0000000000..7f254ab461
--- /dev/null
+++ b/modules/asinl
@@ -0,0 +1,29 @@
+Description:
+asinl() function: inverse sine function with long double argument.
+
+Files:
+lib/asinl.c
+m4/asinl.m4
+
+Depends-on:
+math
+extensions
+sqrtl
+
+configure.ac:
+gl_FUNC_ASINL
+gl_MATH_MODULE_INDICATOR([asinl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ASINL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/atanl b/modules/atanl
new file mode 100644
index 0000000000..f6ba1b85a9
--- /dev/null
+++ b/modules/atanl
@@ -0,0 +1,29 @@
+Description:
+atanl() function: inverse tangent function with long double argument.
+
+Files:
+lib/atanl.c
+m4/atanl.m4
+
+Depends-on:
+math
+extensions
+isnanl
+
+configure.ac:
+gl_FUNC_ATANL
+gl_MATH_MODULE_INDICATOR([atanl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ATANL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/cosl b/modules/cosl
new file mode 100644
index 0000000000..88ebf9c40e
--- /dev/null
+++ b/modules/cosl
@@ -0,0 +1,35 @@
+Description:
+cosl() function: cosine function with long double argument.
+
+Files:
+lib/cosl.c
+lib/trigl.h
+lib/sincosl.c
+lib/trigl.c
+m4/cosl.m4
+
+Depends-on:
+math
+extensions
+float
+isnanl
+floor
+floorl
+
+configure.ac:
+gl_FUNC_COSL
+gl_MATH_MODULE_INDICATOR([cosl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(ACOSL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/expl b/modules/expl
new file mode 100644
index 0000000000..3870440e75
--- /dev/null
+++ b/modules/expl
@@ -0,0 +1,30 @@
+Description:
+expl() function: exponential function with long double argument.
+
+Files:
+lib/expl.c
+m4/expl.m4
+
+Depends-on:
+math
+extensions
+float
+floorl
+
+configure.ac:
+gl_FUNC_EXPL
+gl_MATH_MODULE_INDICATOR([expl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(EXPL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/logl b/modules/logl
new file mode 100644
index 0000000000..c9b7237dc2
--- /dev/null
+++ b/modules/logl
@@ -0,0 +1,31 @@
+Description:
+logl() function: logarithm with long double argument.
+
+Files:
+lib/logl.c
+m4/logl.m4
+
+Depends-on:
+math
+extensions
+frexpl
+isnanl
+floorl
+
+configure.ac:
+gl_FUNC_LOGL
+gl_MATH_MODULE_INDICATOR([logl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(LOGL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/math b/modules/math
index dda67dfc92..f7173bf29d 100644
--- a/modules/math
+++ b/modules/math
@@ -25,8 +25,13 @@ math.h: math.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
+ -e 's|@''GNULIB_ACOSL''@|$(GNULIB_ACOSL)|g' \
+ -e 's|@''GNULIB_ASINL''@|$(GNULIB_ASINL)|g' \
+ -e 's|@''GNULIB_ATANL''@|$(GNULIB_ATANL)|g' \
-e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \
-e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \
+ -e 's|@''GNULIB_COSL''@|$(GNULIB_COSL)|g' \
+ -e 's|@''GNULIB_EXPL''@|$(GNULIB_EXPL)|g' \
-e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \
-e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \
-e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \
@@ -38,17 +43,29 @@ math.h: math.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \
-e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \
-e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \
- -e 's|@''GNULIB_MATHL''@|$(GNULIB_MATHL)|g' \
+ -e 's|@''GNULIB_LOGL''@|$(GNULIB_LOGL)|g' \
-e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \
-e 's|@''GNULIB_ROUNDF''@|$(GNULIB_ROUNDF)|g' \
-e 's|@''GNULIB_ROUNDL''@|$(GNULIB_ROUNDL)|g' \
-e 's|@''GNULIB_SIGNBIT''@|$(GNULIB_SIGNBIT)|g' \
+ -e 's|@''GNULIB_SINL''@|$(GNULIB_SINL)|g' \
+ -e 's|@''GNULIB_SQRTL''@|$(GNULIB_SQRTL)|g' \
+ -e 's|@''GNULIB_TANL''@|$(GNULIB_TANL)|g' \
-e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \
-e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \
-e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \
+ -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
+ -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
+ -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
+ -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
+ -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \
-e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \
-e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \
-e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \
+ -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \
+ -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \
+ -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \
+ -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \
-e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
-e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
-e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
diff --git a/modules/mathl b/modules/mathl
index 0b3018efb4..ac0a27e8b4 100644
--- a/modules/mathl
+++ b/modules/mathl
@@ -2,35 +2,35 @@ Description:
C99 functions for transcendental functions with long double arguments.
Files:
-lib/acosl.c
-lib/asinl.c
-lib/atanl.c
-lib/cosl.c
-lib/expl.c
-lib/logl.c
-lib/sincosl.c
-lib/sinl.c
-lib/sqrtl.c
-lib/tanl.c
-lib/trigl.c
-lib/trigl.h
-m4/mathl.m4
Depends-on:
-float
-math
-frexpl
-isnanl
-ldexpl
floorl
ceill
+acosl
+asinl
+atanl
+cosl
+expl
+logl
+sinl
+sqrtl
+tanl
configure.ac:
-gl_FUNC_LONG_DOUBLE_MATH
-gl_MATH_MODULE_INDICATOR([mathl])
+AC_REQUIRE([gl_FUNC_FLOORL])
+AC_REQUIRE([gl_FUNC_CEILL])
+AC_REQUIRE([gl_FUNC_ACOSL])
+AC_REQUIRE([gl_FUNC_ASINL])
+AC_REQUIRE([gl_FUNC_ATANL])
+AC_REQUIRE([gl_FUNC_COSL])
+AC_REQUIRE([gl_FUNC_EXPL])
+AC_REQUIRE([gl_FUNC_LOGL])
+AC_REQUIRE([gl_FUNC_SINL])
+AC_REQUIRE([gl_FUNC_SQRTL])
+AC_REQUIRE([gl_FUNC_TANL])
+LIBS="$LIBS $FLOORL_LIBM $CEILL_LIBM $ACOSL_LIBM $ASINL_LIBM $ATANL_LIBM $ACOSL_LIBM $EXPL_LIBM $LOGL_LIBM $SINL_LIBM $SQRTL_LIBM $TANL_LIBM"
Makefile.am:
-noinst_HEADERS += trigl.h trigl.c sincosl.c
Include:
<math.h>
diff --git a/modules/sinl b/modules/sinl
new file mode 100644
index 0000000000..67621ed316
--- /dev/null
+++ b/modules/sinl
@@ -0,0 +1,35 @@
+Description:
+sinl() function: sine function with long double argument.
+
+Files:
+lib/sinl.c
+lib/trigl.h
+lib/sincosl.c
+lib/trigl.c
+m4/sinl.m4
+
+Depends-on:
+math
+extensions
+float
+isnanl
+floor
+floorl
+
+configure.ac:
+gl_FUNC_SINL
+gl_MATH_MODULE_INDICATOR([sinl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(SINL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/sqrtl b/modules/sqrtl
new file mode 100644
index 0000000000..d4886665af
--- /dev/null
+++ b/modules/sqrtl
@@ -0,0 +1,33 @@
+Description:
+sqrtl() function: square root with long double argument.
+
+Files:
+lib/sqrtl.c
+m4/sqrtl.m4
+
+Depends-on:
+math
+extensions
+float
+isnanl
+frexpl
+ldexpl
+sqrt
+
+configure.ac:
+gl_FUNC_SQRTL
+gl_MATH_MODULE_INDICATOR([sqrtl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(SQRTL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini
diff --git a/modules/tanl b/modules/tanl
new file mode 100644
index 0000000000..b00fd1bd51
--- /dev/null
+++ b/modules/tanl
@@ -0,0 +1,34 @@
+Description:
+tanl() function: tangent function with long double argument.
+
+Files:
+lib/tanl.c
+lib/trigl.h
+lib/trigl.c
+m4/tanl.m4
+
+Depends-on:
+math
+extensions
+float
+isnanl
+floor
+floorl
+
+configure.ac:
+gl_FUNC_TANL
+gl_MATH_MODULE_INDICATOR([tanl])
+
+Makefile.am:
+
+Include:
+<math.h>
+
+Link:
+$(TANL_LIBM)
+
+License:
+GPL
+
+Maintainer:
+Paolo Bonzini