[openssh-commits] [openssh] branch master updated: Look for sqrt(), possibly in libm.
git+noreply at mindrot.org
git+noreply at mindrot.org
Tue Apr 15 22:01:13 AEST 2025
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
The following commit(s) were added to refs/heads/master by this push:
new 849c2fd89 Look for sqrt(), possibly in libm.
849c2fd89 is described below
commit 849c2fd894aa87a7e40c71e8d5bda5392b1205be
Author: Darren Tucker <dtucker at dtucker.net>
AuthorDate: Tue Apr 15 21:58:49 2025 +1000
Look for sqrt(), possibly in libm.
The unit tests now use sqrt(), which in some platforms (notably
DragonFlyBSD and Solaris) is not in libc but rather libm. Since only
the unit tests use this, add TESTLIBS and if necessary put libm in it.
---
Makefile.in | 2 +-
configure.ac | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 5a7a1bd10..f15ac558a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -557,7 +557,7 @@ regress-prep:
ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile
REGRESSLIBS=libssh.a $(LIBCOMPAT)
-TESTLIBS=$(LIBS) $(CHANNELLIBS)
+TESTLIBS=$(LIBS) $(CHANNELLIBS) @TESTLIBS@
regress/modpipe$(EXEEXT): $(srcdir)/regress/modpipe.c $(REGRESSLIBS)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/modpipe.c \
diff --git a/configure.ac b/configure.ac
index ee77a0484..bbddca009 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1449,6 +1449,11 @@ AC_CHECK_FUNC([getspnam], ,
AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1],
[Define if you have the basename function.])])
+dnl sqrt() only used in unit tests.
+AC_CHECK_FUNC([sqrt], ,
+ [AC_CHECK_LIB([m], [sqrt], [TESTLIBS="$TESTLIBS -lm"])])
+AC_SUBST([TESTLIBS])
+
dnl zlib defaults to enabled
zlib=yes
AC_ARG_WITH([zlib],
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list