-diff -urNp qemu-2.4.0.orig/configure qemu-2.4.0/configure
---- qemu-2.4.0.orig/configure 2015-08-25 06:46:52.000000000 +0000
-+++ qemu-2.4.0/configure 2015-08-25 06:52:47.586593251 +0000
-@@ -3765,9 +3765,11 @@ if test "$smartcard_nss" != "no"; then
- int main(void) { PK11_FreeSlot(0); return 0; }
- EOF
- # FIXME: do not include $glib_* in here
-+ libcacard_libs="$($pkg_config --libs libcacard 2>/dev/null)"
-+ libcacard_cflags="$($pkg_config --cflags libcacard 2>/dev/null)"
- nss_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
- nss_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
-- test_cflags="$nss_cflags"
-+ test_cflags="$libcacard_cflags"
- # The header files in nss < 3.13.3 have a bug which causes them to
- # emit a warning. If we're going to compile QEMU with -Werror, then
- # test that the headers don't have this bug. Otherwise we would pass
-@@ -3779,6 +3781,8 @@ EOF
- $pkg_config --atleast-version=3.12.8 nss && \
- compile_prog "$test_cflags" "$nss_libs"; then
- smartcard_nss="yes"
-+ QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags $nss_cflags"
-+ libs_softmmu="$libcacard_libs $nss_libs $libs_softmmu"
- else
- if test "$smartcard_nss" = "yes"; then
- feature_not_found "nss" "Install nss devel >= 3.12.8"
-@@ -4933,6 +4937,8 @@ fi
-
- if test "$smartcard_nss" = "yes" ; then
- echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
-+ echo "LIBCACARD_LIBS=$libcacard_libs" >> $config_host_mak
-+ echo "LIBCACARD_CFLAGS=$libcacard_cflags" >> $config_host_mak
- echo "NSS_LIBS=$nss_libs" >> $config_host_mak
- echo "NSS_CFLAGS=$nss_cflags" >> $config_host_mak
- fi
-diff -urNp qemu-2.4.0.orig/hw/usb/ccid-card-passthru.c qemu-2.4.0/hw/usb/ccid-card-passthru.c
---- qemu-2.4.0.orig/hw/usb/ccid-card-passthru.c 2015-08-11 19:11:07.000000000 +0000
-+++ qemu-2.4.0/hw/usb/ccid-card-passthru.c 2015-08-25 06:52:53.709593251 +0000
-@@ -12,7 +12,7 @@
- #include "qemu/error-report.h"
- #include "qemu/sockets.h"
- #include "ccid.h"
--#include "libcacard/vscard_common.h"
-+#include <cacard/vscard_common.h>
-
- #define DPRINTF(card, lvl, fmt, ...) \
- do { \
-diff -urNp qemu-2.4.0.orig/Makefile qemu-2.4.0/Makefile
---- qemu-2.4.0.orig/Makefile 2015-08-11 19:11:05.000000000 +0000
-+++ qemu-2.4.0/Makefile 2015-08-25 06:52:47.588593251 +0000
-@@ -157,9 +157,6 @@ dummy := $(call unnest-vars,, \
- ifneq ($(wildcard config-host.mak),)
- include $(SRC_PATH)/tests/Makefile
- endif
--ifeq ($(CONFIG_SMARTCARD_NSS),y)
--include $(SRC_PATH)/libcacard/Makefile
--endif
-
- all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
-
-diff -urNp qemu-2.4.0.orig/Makefile.objs qemu-2.4.0/Makefile.objs
---- qemu-2.4.0.orig/Makefile.objs 2015-08-11 19:11:05.000000000 +0000
-+++ qemu-2.4.0/Makefile.objs 2015-08-25 06:54:03.092593251 +0000
-@@ -75,8 +75,6 @@ common-obj-y += backends/
-
- common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
-
--common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
--
- common-obj-$(CONFIG_FDT) += device_tree.o
-
- ######################################################################