From f8db887eb0f06abbbf0f5a4fff8f93be62e3433d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 24 Nov 2015 02:08:05 +0100 Subject: [PATCH] Use new libcacard.h if possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libcacard.h requires 2.5.1. Keep compatibility for older versions until the transition in distros to the standalone version is done. Signed-off-by: Marc-André Lureau [ Christophe: add < 2.5.1 fallback ] Signed-off-by: Christophe Fergeau --- common/messages.h | 6 +++++- m4/spice-deps.m4 | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common/messages.h b/common/messages.h index 5f5de54..12b1943 100644 --- a/common/messages.h +++ b/common/messages.h @@ -38,8 +38,12 @@ #include #include -#ifdef USE_SMARTCARD +#ifdef USE_SMARTCARD_012 #include +#else +#ifdef USE_SMARTCARD +#include +#endif #endif #include "draw.h" diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4 index cb2b4c0..6237a10 100644 --- a/m4/spice-deps.m4 +++ b/m4/spice-deps.m4 @@ -70,10 +70,16 @@ AC_DEFUN([SPICE_CHECK_SMARTCARD], [ have_smartcard=no if test "x$enable_smartcard" != "xno"; then - PKG_CHECK_MODULES([SMARTCARD], [libcacard >= 0.1.2], [have_smartcard=yes], [have_smartcard=no]) + PKG_CHECK_MODULES([SMARTCARD], [libcacard >= 2.5.1], [have_smartcard=yes], [have_smartcard=no]) + if test "x$have_smartcard" = "xno"; then + PKG_CHECK_MODULES([SMARTCARD], [libcacard >= 0.1.2], [have_smartcard=yes have_smartcard_012=yes], [have_smartcard=no]) + fi if test "x$enable_smartcard" != "xauto" && test "x$have_smartcard" = "xno"; then AC_MSG_ERROR("Smartcard support requested but libcacard could not be found") fi + if test "x$have_smartcard_012" = "xyes"; then + AC_DEFINE(USE_SMARTCARD_012, [1], [Define if supporting smartcard proxying without libcacard.h]) + fi if test "x$have_smartcard" = "xyes"; then AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying]) fi