Skip to content

Commit

Permalink
libcacard: use the standalone project
Browse files Browse the repository at this point in the history
libcacard is now a standalone project hosted with the Spice project (see
the 2.5.0 release announcement), remove it from qemu tree.

Use the library if found during configure or if --enable-smartcard.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
elmarco committed Sep 23, 2015
1 parent 684bb57 commit 7b02f54
Show file tree
Hide file tree
Showing 33 changed files with 21 additions and 5,849 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -19,7 +19,6 @@
/trace/generated-ust.c
/ui/shader/texture-blit-frag.h
/ui/shader/texture-blit-vert.h
/libcacard/trace/generated-tracers.c
*-timestamp
/*-softmmu
/*-darwin-user
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Expand Up @@ -163,9 +163,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

Expand Down
14 changes: 0 additions & 14 deletions Makefile.objs
Expand Up @@ -32,18 +32,6 @@ crypto-aes-obj-y = crypto/

qom-obj-y = qom/

######################################################################
# smartcard

libcacard-y += libcacard/cac.o libcacard/event.o
libcacard-y += libcacard/vcard.o libcacard/vreader.o
libcacard-y += libcacard/vcard_emul_nss.o
libcacard-y += libcacard/vcard_emul_type.o
libcacard-y += libcacard/card_7816.o
libcacard-y += libcacard/vcardt.o
libcacard/vcard_emul_nss.o-cflags := $(NSS_CFLAGS)
libcacard/vcard_emul_nss.o-libs := $(NSS_LIBS)

######################################################################
# Target independent part of system emulation. The long term path is to
# suppress *all* target specific code in case of system emulation, i.e. a
Expand Down Expand Up @@ -85,8 +73,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

######################################################################
Expand Down
52 changes: 18 additions & 34 deletions configure
Expand Up @@ -302,7 +302,7 @@ trace_backends="nop"
trace_file="trace"
spice=""
rbd=""
smartcard_nss=""
smartcard=""
libusb=""
usb_redir=""
opengl=""
Expand Down Expand Up @@ -1039,9 +1039,9 @@ for opt do
;;
--enable-xfsctl) xfs="yes"
;;
--disable-smartcard-nss) smartcard_nss="no"
--disable-smartcard) smartcard="no"
;;
--enable-smartcard-nss) smartcard_nss="yes"
--enable-smartcard) smartcard="yes"
;;
--disable-libusb) libusb="no"
;;
Expand Down Expand Up @@ -1354,7 +1354,7 @@ disabled with --disable-FEATURE, default is enabled if available:
rbd rados block device (rbd)
libiscsi iscsi support
libnfs nfs support
smartcard-nss smartcard nss support
smartcard smartcard support (libcacard)
libusb libusb (for usb passthrough)
usb-redir usb network redirection support
lzo support of lzo compression library
Expand Down Expand Up @@ -3810,34 +3810,20 @@ EOF
fi
fi

# check for libcacard for smartcard support
# check for smartcard support
smartcard_cflags=""
# TODO - what's the minimal nss version we support?
if test "$smartcard_nss" != "no"; then
cat > $TMPC << EOF
#include <pk11pub.h>
int main(void) { PK11_FreeSlot(0); return 0; }
EOF
# FIXME: do not include $glib_* in here
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"
# 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
# the configure test but fail to compile QEMU later.
if test "$werror" = "yes"; then
test_cflags="-Werror $test_cflags"
fi
if test -n "$libtool" &&
$pkg_config --atleast-version=3.12.8 nss && \
compile_prog "$test_cflags" "$nss_libs"; then
smartcard_nss="yes"
if test "$smartcard" != "no"; then
if $pkg_config libcacard; then
libcacard_cflags=$($pkg_config --cflags libcacard)
libcacard_libs=$($pkg_config --libs libcacard)
QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags"
libs_softmmu="$libs_softmmu $libcacard_libs"
smartcard="yes"
else
if test "$smartcard_nss" = "yes"; then
feature_not_found "nss" "Install nss devel >= 3.12.8"
if test "$smartcard" = "yes"; then
feature_not_found "smartcard" "Install libcacard devel"
fi
smartcard_nss="no"
smartcard="no"
fi
fi

Expand Down Expand Up @@ -4618,7 +4604,7 @@ echo "spice support $spice"
fi
echo "rbd support $rbd"
echo "xfsctl support $xfs"
echo "nss used $smartcard_nss"
echo "smartcard support $smartcard"
echo "libusb $libusb"
echo "usb net redir $usb_redir"
echo "OpenGL support $opengl"
Expand Down Expand Up @@ -4995,10 +4981,8 @@ if test "$spice" = "yes" ; then
echo "CONFIG_SPICE=y" >> $config_host_mak
fi

if test "$smartcard_nss" = "yes" ; then
echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
echo "NSS_LIBS=$nss_libs" >> $config_host_mak
echo "NSS_CFLAGS=$nss_cflags" >> $config_host_mak
if test "$smartcard" = "yes" ; then
echo "CONFIG_SMARTCARD=y" >> $config_host_mak
fi

if test "$libusb" = "yes" ; then
Expand Down

0 comments on commit 7b02f54

Please sign in to comment.