[Spice-devel] [spice-common 1/2] build: Ensure we link with -lm if needed

Christophe Fergeau cfergeau at redhat.com
Mon Jun 4 08:17:10 UTC 2018


lines.c uses hypot(), which is found in libm on some systems.

Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
 m4/spice-deps.m4 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 7c0cca4..cf0e048 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -64,6 +64,10 @@ AC_DEFUN([SPICE_CHECK_SYSDEPS], [
     AC_FUNC_ERROR_AT_LINE
     AC_FUNC_FORK
     AC_CHECK_FUNCS([dup2 floor inet_ntoa memmove memset pow sqrt])
+    AC_SEARCH_LIBS([hypot], [m], [], [
+        AC_MSG_ERROR([unable to find the hypot() function])
+    ])
+
 ])
 
 
-- 
2.17.1



More information about the Spice-devel mailing list