unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 55294-done@debbugs.gnu.org, Steve Downey <sdowney@gmail.com>
Subject: bug#55294: Configure failure on Solaris 11.4
Date: Tue, 10 May 2022 14:49:30 -0700	[thread overview]
Message-ID: <90ab237b-7da6-6da0-923c-f501c808d41c@cs.ucla.edu> (raw)
In-Reply-To: <835ymdtwuc.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]

On 5/10/22 05:07, Eli Zaretskii wrote:
> I think it's easy enough, and I'm sure Paul will be able to do that.

Sure, I installed the attached. Closing the bug report.

[-- Attachment #2: 0001-Port-libm-configure-time-test-to-Solaris-11.4.patch --]
[-- Type: text/x-patch, Size: 2334 bytes --]

From 203ffc68468abaccfed7e8ee630d9aa143ce5dbf Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 10 May 2022 14:44:35 -0700
Subject: [PATCH 1/2] Port libm configure-time test to Solaris 11.4

* configure.ac (LIB_MATH): Check all the math.h functions
that Emacs uses, not just sqrt (Bug#55294).
---
 configure.ac | 67 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 57 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 484ce980a5..1ba4448d1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1617,16 +1617,63 @@ AC_DEFUN
 # Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
 AC_DEFUN([AC_TYPE_UID_T])
 
-# sqrt and other floating-point functions such as fmod and frexp
-# are found in -lm on many systems.
-OLD_LIBS=$LIBS
-AC_SEARCH_LIBS([sqrt], [m])
-if test "X$LIBS" = "X$OLD_LIBS"; then
-  LIB_MATH=
-else
-  LIB_MATH=$ac_cv_search_sqrt
-fi
-LIBS=$OLD_LIBS
+# Check for all math.h functions that Emacs uses; on some platforms,
+# -lm is needed for some of these functions.
+AC_CACHE_CHECK([for math library],
+  [emacs_cv_lib_math],
+  [OLD_LIBS=$LIBS
+   AC_LINK_IFELSE(
+     [AC_LANG_SOURCE([[
+	#include <math.h>
+	int
+	main (int argc, char **argv)
+	{
+	  double d = argc;
+	  float f = argc;
+	  int i = argc;
+	  long l = argc;
+	  d = acos (d);
+	  d = asin (d);
+	  d = atan (d);
+	  d = atan2 (d, d);
+	  d = ceil (d);
+	  d = copysign (d, d);
+	  d = cos (d);
+	  d = exp (d);
+	  d = fabs (d);
+	  d = floor (d);
+	  d = fmod (d, d);
+	  d = frexp (d, &i);
+	  d = ldexp (d, i);
+	  d = log (d);
+	  d = log2 (d);
+	  d = log10 (d);
+	  d = pow (d, d);
+	  d = rint (d);
+	  d = scalbn (d, l);
+	  d = sin (d);
+	  d = sqrt (d);
+	  d = tan (d);
+	  d = trunc (d);
+	  f = fabsf (f);
+	  f = powf (f, f);
+	  i = ilogb (d);
+	  i = signbit (d);
+	  l = lrint (d);
+	  l = lround (d);
+	  return d == f && i == l;
+	}
+     ]])],
+     [emacs_cv_lib_math='none required'],
+     [LIBS="-lm $LIBS"
+      AC_LINK_IFELSE([],
+        [emacs_cv_lib_math=-lm],
+	[AC_MSG_ERROR([Math library (-lm) not found])])])
+   LIBS=$OLD_LIBS])
+case $emacs_cv_lib_math in
+  -*) LIB_MATH=$emacs_cv_lib_math;;
+  *)  LIB_MATH=;;
+esac
 
 dnl Current possibilities handled by sed (aix4-2 -> aix,
 dnl gnu-linux -> gnu/linux, etc.):
-- 
2.35.3


[-- Attachment #3: 0002-src-floatfns.c-Update-comment.patch --]
[-- Type: text/x-patch, Size: 2031 bytes --]

From 4433df3b2015b3b1acd9d24bf7169c010fb51a05 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 10 May 2022 14:47:09 -0700
Subject: [PATCH 2/2] * src/floatfns.c: Update comment.

---
 src/floatfns.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/floatfns.c b/src/floatfns.c
index f2b3b13acd..293184c70f 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -29,14 +29,20 @@ Copyright (C) 1988, 1993-1994, 1999, 2001-2022 Free Software Foundation,
 
    C99 and C11 require the following math.h functions in addition to
    the C89 functions.  Of these, Emacs currently exports only the
-   starred ones to Lisp, since we haven't found a use for the others:
-   acosh, atanh, cbrt, *copysign, erf, erfc, exp2, expm1, fdim, fma,
-   fmax, fmin, fpclassify, hypot, ilogb, isfinite, isgreater,
-   isgreaterequal, isinf, isless, islessequal, islessgreater, *isnan,
-   isnormal, isunordered, lgamma, log1p, *log2 [via (log X 2)], *logb
-   (approximately), lrint/llrint, lround/llround, nan, nearbyint,
-   nextafter, nexttoward, remainder, remquo, *rint, round, scalbln,
-   scalbn, signbit, tgamma, *trunc.
+   starred ones to Lisp, since we haven't found a use for the others.
+   Also, it uses the ones marked "+" internally:
+   acosh, atanh, cbrt, copysign (implemented by signbit), erf, erfc,
+   exp2, expm1, fdim, fma, fmax, fmin, fpclassify, hypot, +ilogb,
+   isfinite, isgreater, isgreaterequal, isinf, isless, islessequal,
+   islessgreater, *isnan, isnormal, isunordered, lgamma, log1p, *log2
+   [via (log X 2)], logb (approximately; implemented by frexp),
+   +lrint/llrint, +lround/llround, nan, nearbyint, nextafter,
+   nexttoward, remainder, remquo, *rint, round, scalbln, +scalbn,
+   +signbit, tgamma, *trunc.
+
+   The C standard also requires functions for float and long double
+   that are not listed above.  Of these functions, Emacs uses only the
+   following internally: fabsf, powf, sprintf.
  */
 
 #include <config.h>
-- 
2.35.3


      reply	other threads:[~2022-05-10 21:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 19:58 bug#55294: Configure failure on Solaris 11.4 Steve Downey
2022-05-07  5:40 ` Eli Zaretskii
2022-05-09 19:07 ` Paul Eggert
2022-05-09 19:21   ` Eli Zaretskii
2022-05-09 19:34     ` Paul Eggert
2022-05-10  0:15   ` Steve Downey
2022-05-10  2:35     ` Eli Zaretskii
2022-05-10  4:46       ` Steve Downey
2022-05-10 12:07         ` Eli Zaretskii
2022-05-10 21:49           ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90ab237b-7da6-6da0-923c-f501c808d41c@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=55294-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=sdowney@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).