[Spice-devel] [PATCH 4/4] smartcard: configure option --enable-smartcard

Alon Levy alevy at redhat.com
Wed Oct 6 01:38:12 PDT 2010


---
 client/Makefile.am     |    8 +++++++-
 client/x11/Makefile.am |    9 +++++++++
 configure.ac           |   23 +++++++++++++++++++++++
 server/Makefile.am     |   11 +++++++++++
 4 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/client/Makefile.am b/client/Makefile.am
index 185518a..019aa94 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -28,6 +28,12 @@ else
 GL_SRCS =
 endif
 
+if SUPPORT_SMARTCARD
+SMARTCARD_SRCS = smartcard_channel.cpp
+else
+SMARTCARD_SRCS =
+endif
+
 RED_COMMON_SRCS =			\
 	application.cpp			\
 	application.h			\
@@ -130,6 +136,6 @@ GDI_FILES =				\
 
 MAINTAINERCLEANFILES = $(spice_built_sources)
 
-EXTRA_DIST = $(RED_COMMON_SRCS) $(spice_built_sources) $(GL_SRCS) $(GDI_FILES)
+EXTRA_DIST = $(RED_COMMON_SRCS) $(spice_built_sources) $(GL_SRCS) $(GDI_FILES) $(SMARTCARD_SRCS)
 
 BUILT_SOURCES = $(spice_built_sources)
diff --git a/client/x11/Makefile.am b/client/x11/Makefile.am
index a992aa1..5e85417 100644
--- a/client/x11/Makefile.am
+++ b/client/x11/Makefile.am
@@ -26,6 +26,7 @@ INCLUDES = \
 	$(CEGUI_CFLAGS)					\
 	$(WARN_CFLAGS)                                  \
 	$(SPICE_NONPKGCONFIG_CFLAGS)			\
+	$(SMARTCARD_CFLAGS)				\
 	$(NULL)
 
 
@@ -153,6 +154,12 @@ else
 RED_OGL_SRCS =
 endif
 
+if SUPPORT_SMARTCARD
+RED_SCARD_SRCS = $(CLIENT_DIR)/smartcard_channel.cpp
+else
+RED_SCARD_SRCS =
+endif
+
 bin_PROGRAMS = spicec
 
 spicec_SOURCES =			\
@@ -186,6 +193,7 @@ spicec_SOURCES =			\
 	$(RED_GUI_SRCS)			\
 	$(RED_TUNNEL_SRCS)		\
 	$(RED_OGL_SRCS)			\
+	$(RED_SCARD_SRCS)		\
 	$(NULL)
 
 spicec_LDFLAGS = \
@@ -195,6 +203,7 @@ spicec_LDFLAGS = \
 	$(CEGUI_LIBS)					\
 	$(JPEG_LIBS)					\
 	$(Z_LIBS)					\
+	$(SMARTCARD_LIBS)				\
 	$(SPICE_NONPKGCONFIG_LIBS)
 
 spicec_LDADD =						\
diff --git a/configure.ac b/configure.ac
index 4fea09c..b724441 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,6 +113,16 @@ AC_ARG_ENABLE(opengl,
 [  --enable-opengl         Enable opengl requirement / support (not recommended)],
 [  have_opengl=yes])
 AM_CONDITIONAL(SUPPORT_GL, test "x$have_opengl" = "xyes")
+
+have_smartcard=no
+AC_ARG_ENABLE(smartcard,
+[  --enable-smartcard         Enable network redirection],
+[  have_smartcard=yes])
+AM_CONDITIONAL(SUPPORT_SMARTCARD, test "x$have_smartcard" = "xyes")
+if test "x$have_smartcard" = "xyes"; then
+   AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying])
+fi
+
 dnl =========================================================================
 dnl Check deps
 
@@ -168,6 +178,17 @@ if test "x$have_tunnel" = "xyes"; then
 	AC_DEFINE([HAVE_SLIRP], [], [Define if we have slirp])
 fi
 
+if test "x$have_smartcard" = "xyes"; then
+    # TODO - check for libcaccard (after it has pkg-config support)
+    PKG_CHECK_MODULES(CAC_CARD, cac_card >= 0.0.1)
+    SMARTCARD_LIBS="$CAC_CARD_LIBS"
+    SMARTCARD_CFLAGS="$CAC_CARD_CFLAGS"
+    SPICE_REQUIRES+=" cac_card"
+    AC_SUBST(SMARTCARD_LIBS)
+    AC_SUBST(SMARTCARD_CFLAGS)
+fi
+
+
 PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.7)
 AC_SUBST(PIXMAN_CFLAGS)
 AC_SUBST(PIXMAN_LIBS)
@@ -420,5 +441,7 @@ echo "
 
         GUI:                      ${use_gui}
 
+        Smartcard:                ${have_smartcard}
+
         Now type 'make' to build $PACKAGE
 "
diff --git a/server/Makefile.am b/server/Makefile.am
index debcd27..42f9af4 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -15,6 +15,7 @@ INCLUDES = \
 	-DRED_STATISTICS			\
 	$(WARN_CFLAGS)                          \
 	$(VISIBILITY_HIDDEN_CFLAGS)		\
+	$(SMARTCARD_CFLAGS)				\
 	$(NULL)
 
 spice_built_sources = generated_marshallers.c generated_marshallers.h generated_demarshallers.c
@@ -79,6 +80,15 @@ else
 TUNNEL_SRCS =
 endif
 
+if SUPPORT_SMARTCARD
+SMARTCARD_SRCS =		\
+	smartcard.c			\
+	smartcard.h			\
+	$(NULL)
+else
+SMARTCARD_SRCS =
+endif
+
 libspice_server_la_SOURCES =			\
 	demarshallers.h				\
 	glz_encoder.c				\
@@ -118,6 +128,7 @@ libspice_server_la_SOURCES =			\
 	zlib_encoder.c				\
 	zlib_encoder.h				\
 	$(TUNNEL_SRCS)				\
+	$(SMARTCARD_SRCS)			\
 	$(COMMON_SRCS)				\
 	$(GL_SRCS)				\
 	$(NULL)
-- 
1.7.3.1



More information about the Spice-devel mailing list