[Spice-commits] configure.ac
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 20 06:47:05 UTC 2021
configure.ac | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
New commits:
commit c84f9942d7d57463c4790c8e0aad67c096c71415
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Wed Nov 4 13:09:01 2020 +0000
Better error reporting if zlib or libpng are not static
Tell the specific library which is not static.
Previously any would be reported as libpng.
This fixes https://gitlab.freedesktop.org/spice/win32/vd_agent/-/issues/17
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
Acked-by: Jakub Janků <jjanku at redhat.com>
diff --git a/configure.ac b/configure.ac
index 312b88a..b55389d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,8 +103,27 @@ dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
-PKG_CHECK_MODULES_STATIC(LIBPNG, [libpng])
+ACX_SET_VAR(CFLAGS, "$CFLAGS -Wall",
+ ACX_SET_VAR(LDFLAGS, "$LDFLAGS -static",
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[
+ printf("hello");
+ return 0
+ ]])], [], AC_MSG_ERROR([some base static library (possibly pthread) not found]))
+ )
+)
+
PKG_CHECK_MODULES_STATIC(ZLIB, [zlib])
+ACX_SET_VAR(CFLAGS, "$CFLAGS $ZLIB_CFLAGS -Wall",
+ ACX_SET_VAR(LDFLAGS, "$LDFLAGS -static",
+ ACX_SET_VAR(LIBS, "$LIBS $ZLIB_LIBS",
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[
+ return !!zlibVersion()
+ ]])], [], AC_MSG_ERROR([static zlib not found]))
+ )
+ )
+)
+
+PKG_CHECK_MODULES_STATIC(LIBPNG, [libpng])
ACX_SET_VAR(CFLAGS, "$CFLAGS $LIBPNG_CFLAGS -Wall",
ACX_SET_VAR(LDFLAGS, "$LDFLAGS -static",
ACX_SET_VAR(LIBS, "$LIBS $LIBPNG_LIBS",
More information about the Spice-commits
mailing list