From patchwork Sun Nov 28 14:46:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 73335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B7CB4B70B0 for ; Mon, 29 Nov 2010 02:37:04 +1100 (EST) Received: from localhost ([127.0.0.1]:43471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMik3-0007bm-0F for incoming@patchwork.ozlabs.org; Sun, 28 Nov 2010 10:00:39 -0500 Received: from [140.186.70.92] (port=52804 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMiWs-00014y-Ir for qemu-devel@nongnu.org; Sun, 28 Nov 2010 09:47:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PMiWq-0007At-F5 for qemu-devel@nongnu.org; Sun, 28 Nov 2010 09:47:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PMiWq-0007AW-82 for qemu-devel@nongnu.org; Sun, 28 Nov 2010 09:47:00 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oASEkxaX003951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 28 Nov 2010 09:46:59 -0500 Received: from playa.tlv.redhat.com (dhcp-3-210.tlv.redhat.com [10.35.3.210]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oASEkmRW017343 for ; Sun, 28 Nov 2010 09:46:58 -0500 From: Alon Levy To: qemu-devel@nongnu.org Date: Sun, 28 Nov 2010 16:46:45 +0200 Message-Id: <1290955607-25821-5-git-send-email-alevy@redhat.com> In-Reply-To: <1290955607-25821-1-git-send-email-alevy@redhat.com> References: <1290955607-25821-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 4/6] libcaccard: update configure to build and use internal libcaccard X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Alon Levy --- Makefile | 6 ++++-- Makefile.objs | 5 +++++ Makefile.target | 2 ++ configure | 24 ++++++++++++++++++++++++ libcaccard/Makefile | 18 ++++++++++++++++++ 5 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 libcaccard/Makefile diff --git a/Makefile b/Makefile index 4e120a2..e673bf1 100644 --- a/Makefile +++ b/Makefile @@ -172,6 +172,8 @@ check-qlist: check-qlist.o qlist.o qint.o $(CHECK_PROG_DEPS) check-qfloat: check-qfloat.o qfloat.o $(CHECK_PROG_DEPS) check-qjson: check-qjson.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o qjson.o json-streamer.o json-lexer.o json-parser.o $(CHECK_PROG_DEPS) +QEMULIBS=libhw32 libhw64 libuser libdis libdis-user libcaccard + clean: # avoid old build problems by removing potentially incorrect old files rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h @@ -183,7 +185,7 @@ clean: rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp rm -f trace-dtrace.h trace-dtrace.h-timestamp $(MAKE) -C tests clean - for d in $(ALL_SUBDIRS) libhw32 libhw64 libuser libdis libdis-user; do \ + for d in $(ALL_SUBDIRS) $(QEMULIBS); do \ if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \ rm -f $$d/qemu-options.def; \ done @@ -194,7 +196,7 @@ distclean: clean rm -f roms/seabios/config.mak roms/vgabios/config.mak rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.dvi qemu-doc.fn qemu-doc.info qemu-doc.ky qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp qemu-doc.vr rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr - for d in $(TARGET_DIRS) libhw32 libhw64 libuser libdis libdis-user; do \ + for d in $(TARGET_DIRS) $(QEMULIBS); do \ rm -rf $$d || exit 1 ; \ done diff --git a/Makefile.objs b/Makefile.objs index 2059e89..82691c0 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -297,6 +297,11 @@ user-obj-y += qemu-timer-common.o endif endif +###################################################################### +# smartcard + +libcaccard-y = cac.o event.o passthru.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o card_7816.o + vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS) diff --git a/Makefile.target b/Makefile.target index 2800f47..7dd6932 100644 --- a/Makefile.target +++ b/Makefile.target @@ -341,6 +341,8 @@ obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y)) endif # CONFIG_SOFTMMU +obj-y += $(addprefix $(SRC_PATH)/libcaccard/, $(libcaccard-$(CONFIG_SMARTCARD))) + obj-y += $(addprefix ../, $(trace-obj-y)) obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o diff --git a/configure b/configure index fb9eac2..4b55904 100755 --- a/configure +++ b/configure @@ -2130,6 +2130,25 @@ EOF fi fi +# check for libcaccard for smartcard support +if test "$smartcard" != "no" ; then + smartcard_cflags="-I\$(SRC_PATH)/libcaccard" + smartcard_libs="-L\$(SRC_PATH)/libcaccard -lcaccard" + libcaccard_libs=$($pkgconfig --libs nss 2>/dev/null) + libcaccard_cflags=$($pkgconfig --cflags nss) + # TODO - what's the minimal nss version we support? + if $pkgconfig --atleast-version=3.12.8 nss; then + smartcard="yes" + QEMU_CFLAGS="$QEMU_CFLAGS $smartcard_cflags $libcaccard_cflags" + LIBS="$libcaccard_libs $LIBS" + else + if test "smartcard" = "yes" ; then + feature_not_found "smartcard" + fi + smartcard="no" + fi +fi + ########################################## ########################################## @@ -2956,6 +2975,11 @@ fi if test "$target_darwin_user" = "yes" ; then echo "CONFIG_DARWIN_USER=y" >> $config_target_mak fi +if test "$smartcard" = "yes" ; then + echo "subdir-$target: subdir-libcaccard" >> $config_host_mak + echo "libcaccard_libs=$libcaccard_libs" >> $config_host_mak + echo "libcaccard_cflags=$libcaccard_cflags" >> $config_host_mak +fi list="" if test ! -z "$gdb_xml_files" ; then for x in $gdb_xml_files; do diff --git a/libcaccard/Makefile b/libcaccard/Makefile new file mode 100644 index 0000000..a339af1 --- /dev/null +++ b/libcaccard/Makefile @@ -0,0 +1,18 @@ +include ../Makefile.objs +include ../config-host.mak +include ../config-all-devices.mak +include $(SRC_PATH)/rules.mak + +CFLAGS+=-fPIC + +libcaccard.so: $(libcaccard-y) + gcc -shared $(libcaccard_libs) -o $@ $^ + +vscclient: $(libcaccard-y) vscclient.o + gcc $(libcaccard_libs) -o $@ $^ + +all: libcaccard.so vscclient + +clean: + rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ libcaccard.so +