[virt-tools-list] [PATCH virt-viewer] build: Explicitly link against librest

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu May 31 16:56:00 UTC 2018


In remote-viewer, there is an explicit call to rest_proxy_auth_cancel(),
so we should be linking against librest as well. This patch fixes the
following error:

make[3]: Entering directory '/home/elima/projects/spice/virt-viewer/src'
  CCLD     remote-viewer
/usr/bin/ld: remote_viewer-remote-viewer.o: undefined reference to symbol 'rest_proxy_auth_cancel'
/home/elima/install/govirt-usr/lib/librest-0.7.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
 configure.ac    | 3 ++-
 src/Makefile.am | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index e262e31..c6aeeda 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,7 +187,8 @@ AS_IF([test "x$with_ovirt" = "xyes"],
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <govirt/govirt.h>]],
         [static int err = OVIRT_REST_CALL_ERROR_CANCELLED;
          void *fun = rest_proxy_auth_cancel;])],
-        [AC_DEFINE([HAVE_OVIRT_CANCEL], 1, [Have rest_proxy_auth_cancel and OVIRT_REST_CALL_ERROR_CANCELLED?])],
+        [AC_DEFINE([HAVE_OVIRT_CANCEL], 1, [Have rest_proxy_auth_cancel and OVIRT_REST_CALL_ERROR_CANCELLED?])
+         PKG_CHECK_MODULES([REST], [rest-0.7 >= 0.7.92])],
         [])
        AC_CHECK_FUNCS([ovirt_api_search_vms ovirt_vm_get_host ovirt_host_get_cluster ovirt_cluster_get_data_center],
                       [AC_DEFINE([HAVE_OVIRT_DATA_CENTER], 1, [Have support for data center])],
diff --git a/src/Makefile.am b/src/Makefile.am
index 0a3cbbf..501c688 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -113,6 +113,7 @@ COMMON_LIBS = \
 	$(SPICE_GTK_LIBS)			\
 	$(LIBXML2_LIBS)				\
 	$(OVIRT_LIBS) \
+	$(REST_LIBS) \
 	$(NULL)
 
 COMMON_CFLAGS = \
@@ -124,6 +125,7 @@ COMMON_CFLAGS = \
 	$(SPICE_GTK_CFLAGS) \
 	$(LIBXML2_CFLAGS) \
 	$(OVIRT_CFLAGS) \
+	$(REST_CFLAGS) \
 	$(WARN_CFLAGS) \
 	$(NULL)
 
-- 
2.14.4




More information about the virt-tools-list mailing list