]> TLD Linux GIT Repositories - packages/qemu.git/blob - qemu-system-libcacard.patch
b5d9c066c6b093f7dad086f031825b04048207ea
[packages/qemu.git] / qemu-system-libcacard.patch
1 diff -urNp qemu-2.4.0.orig/configure qemu-2.4.0/configure
2 --- qemu-2.4.0.orig/configure   2015-08-25 06:46:52.000000000 +0000
3 +++ qemu-2.4.0/configure        2015-08-25 06:52:47.586593251 +0000
4 @@ -3765,9 +3765,11 @@ if test "$smartcard_nss" != "no"; then
5  int main(void) { PK11_FreeSlot(0); return 0; }
6  EOF
7      # FIXME: do not include $glib_* in here
8 +    libcacard_libs="$($pkg_config --libs libcacard 2>/dev/null)"
9 +    libcacard_cflags="$($pkg_config --cflags libcacard 2>/dev/null)"
10      nss_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
11      nss_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
12 -    test_cflags="$nss_cflags"
13 +    test_cflags="$libcacard_cflags"
14      # The header files in nss < 3.13.3 have a bug which causes them to
15      # emit a warning. If we're going to compile QEMU with -Werror, then
16      # test that the headers don't have this bug. Otherwise we would pass
17 @@ -3779,6 +3781,8 @@ EOF
18         $pkg_config --atleast-version=3.12.8 nss && \
19        compile_prog "$test_cflags" "$nss_libs"; then
20          smartcard_nss="yes"
21 +        QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags $nss_cflags"
22 +        libs_softmmu="$libcacard_libs $nss_libs $libs_softmmu"
23      else
24          if test "$smartcard_nss" = "yes"; then
25              feature_not_found "nss" "Install nss devel >= 3.12.8"
26 @@ -4933,6 +4937,8 @@ fi
27  
28  if test "$smartcard_nss" = "yes" ; then
29    echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
30 +  echo "LIBCACARD_LIBS=$libcacard_libs" >> $config_host_mak
31 +  echo "LIBCACARD_CFLAGS=$libcacard_cflags" >> $config_host_mak
32    echo "NSS_LIBS=$nss_libs" >> $config_host_mak
33    echo "NSS_CFLAGS=$nss_cflags" >> $config_host_mak
34  fi
35 diff -urNp qemu-2.4.0.orig/hw/usb/ccid-card-passthru.c qemu-2.4.0/hw/usb/ccid-card-passthru.c
36 --- qemu-2.4.0.orig/hw/usb/ccid-card-passthru.c 2015-08-11 19:11:07.000000000 +0000
37 +++ qemu-2.4.0/hw/usb/ccid-card-passthru.c      2015-08-25 06:52:53.709593251 +0000
38 @@ -12,7 +12,7 @@
39  #include "qemu/error-report.h"
40  #include "qemu/sockets.h"
41  #include "ccid.h"
42 -#include "libcacard/vscard_common.h"
43 +#include <cacard/vscard_common.h>
44  
45  #define DPRINTF(card, lvl, fmt, ...)                    \
46  do {                                                    \
47 diff -urNp qemu-2.4.0.orig/Makefile qemu-2.4.0/Makefile
48 --- qemu-2.4.0.orig/Makefile    2015-08-11 19:11:05.000000000 +0000
49 +++ qemu-2.4.0/Makefile 2015-08-25 06:52:47.588593251 +0000
50 @@ -157,9 +157,6 @@ dummy := $(call unnest-vars,, \
51  ifneq ($(wildcard config-host.mak),)
52  include $(SRC_PATH)/tests/Makefile
53  endif
54 -ifeq ($(CONFIG_SMARTCARD_NSS),y)
55 -include $(SRC_PATH)/libcacard/Makefile
56 -endif
57  
58  all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
59  
60 diff -urNp qemu-2.4.0.orig/Makefile.objs qemu-2.4.0/Makefile.objs
61 --- qemu-2.4.0.orig/Makefile.objs       2015-08-11 19:11:05.000000000 +0000
62 +++ qemu-2.4.0/Makefile.objs    2015-08-25 06:54:03.092593251 +0000
63 @@ -75,8 +75,6 @@ common-obj-y += backends/
64  
65  common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
66  
67 -common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
68 -
69  common-obj-$(CONFIG_FDT) += device_tree.o
70  
71  ######################################################################