]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Look for sqrt(), possibly in libm.
authorDarren Tucker <dtucker@dtucker.net>
Tue, 15 Apr 2025 11:58:49 +0000 (21:58 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Tue, 15 Apr 2025 11:58:49 +0000 (21:58 +1000)
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
configure.ac

index 5a7a1bd101e3f4aeab29e6e65974b12c475d7f4d..f15ac558aea7e692e23dc9729fc7dd9f5df88b3e 100644 (file)
@@ -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 \
index ee77a0484b19828e2533c4dd6d679263291d27bd..bbddca00908b866f01d7c79e1538ef4881a71abc 100644 (file)
@@ -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],