libcacard: initial commit
libcacard emulates a Common Access Card (CAC) which is a standard
for smartcards. It is used by the emulated ccid card introduced in
a following patch. Docs are available in docs/libcacard.txt
Signed-off-by: Alon Levy <alevy@redhat.com>
---
changes from v24->v25:
* Fix out of tree builds.
* Fix build with linux-user targets.
changes from v23->v24: (Jes Sorensen review 2)
* Makefile.target: use obj-$(CONFIG_*) +=
* remove unrequired includes, include qemu-common before qemu-thread
* required adding #define NO_NSPR_10_SUPPORT (harmless)
changes from v22->v23:
* configure fixes: (reported by Stefan Hajnoczi)
* test a = b, not a == b (second isn't portable)
* quote $source_path in case it contains spaces
- this doesn't really help since there are many other places
that need similar fixes, not introduced by this patch.
changes from v21->v22:
* fix configure to not link libcacard if nss not found
(reported by Stefan Hajnoczi)
* fix vscclient linkage with simpletrace backend
(reported by Stefan Hajnoczi)
* card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
(reported by William van de Velde)
changes from v20->v21: (Jes Sorensen review)
* use qemu infrastructure: qemu-thread, qemu-common (qemu_malloc
and qemu_free), error_report
* assert instead of ASSERT
* cosmetic fixes
* use strpbrk and isspace
* add --disable-nss --enable-nss here, instead of in the final patch.
* split vscclient, passthru and docs to following patches.
changes from v19->v20:
* checkpatch.pl
changes from v15->v16:
Build:
* don't erase self with distclean
* fix make clean after make distclean
* Makefile: make vscclient link quiet
Behavioral:
* vcard_emul_nss: load coolkey in more situations
* vscclient:
* use hton,ntoh
* send init on connect, only start vevent thread on response
* read payload after header check, before type switch
* remove Reconnect
* update for vscard_common changes, empty Flush implementation
Style/Whitespace:
* fix wrong variable usage
* remove unused variable
* use only C style comments
* add copyright header
* fix tabulation
Signed-off-by: Alon Levy <alevy@redhat.com>
libcacard: fix out of tree builds
2010-11-28 17:36:38 +03:00
|
|
|
-include ../config-host.mak
|
|
|
|
-include $(SRC_PATH)/Makefile.objs
|
|
|
|
-include $(SRC_PATH)/rules.mak
|
|
|
|
|
2011-06-27 13:58:20 +04:00
|
|
|
libcacard_srcpath=$(SRC_PATH)/libcacard
|
|
|
|
libcacard_includedir=$(includedir)/cacard
|
|
|
|
|
|
|
|
$(call set-vpath, $(SRC_PATH):$(libcacard_srcpath))
|
libcacard: initial commit
libcacard emulates a Common Access Card (CAC) which is a standard
for smartcards. It is used by the emulated ccid card introduced in
a following patch. Docs are available in docs/libcacard.txt
Signed-off-by: Alon Levy <alevy@redhat.com>
---
changes from v24->v25:
* Fix out of tree builds.
* Fix build with linux-user targets.
changes from v23->v24: (Jes Sorensen review 2)
* Makefile.target: use obj-$(CONFIG_*) +=
* remove unrequired includes, include qemu-common before qemu-thread
* required adding #define NO_NSPR_10_SUPPORT (harmless)
changes from v22->v23:
* configure fixes: (reported by Stefan Hajnoczi)
* test a = b, not a == b (second isn't portable)
* quote $source_path in case it contains spaces
- this doesn't really help since there are many other places
that need similar fixes, not introduced by this patch.
changes from v21->v22:
* fix configure to not link libcacard if nss not found
(reported by Stefan Hajnoczi)
* fix vscclient linkage with simpletrace backend
(reported by Stefan Hajnoczi)
* card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
(reported by William van de Velde)
changes from v20->v21: (Jes Sorensen review)
* use qemu infrastructure: qemu-thread, qemu-common (qemu_malloc
and qemu_free), error_report
* assert instead of ASSERT
* cosmetic fixes
* use strpbrk and isspace
* add --disable-nss --enable-nss here, instead of in the final patch.
* split vscclient, passthru and docs to following patches.
changes from v19->v20:
* checkpatch.pl
changes from v15->v16:
Build:
* don't erase self with distclean
* fix make clean after make distclean
* Makefile: make vscclient link quiet
Behavioral:
* vcard_emul_nss: load coolkey in more situations
* vscclient:
* use hton,ntoh
* send init on connect, only start vevent thread on response
* read payload after header check, before type switch
* remove Reconnect
* update for vscard_common changes, empty Flush implementation
Style/Whitespace:
* fix wrong variable usage
* remove unused variable
* use only C style comments
* add copyright header
* fix tabulation
Signed-off-by: Alon Levy <alevy@redhat.com>
libcacard: fix out of tree builds
2010-11-28 17:36:38 +03:00
|
|
|
|
2011-05-15 12:51:28 +04:00
|
|
|
# objects linked against normal qemu binaries, not compiled with libtool
|
2011-08-21 17:36:21 +04:00
|
|
|
QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y))
|
2011-05-15 12:51:28 +04:00
|
|
|
|
|
|
|
# objects linked into a shared library, built with libtool with -fPIC if required
|
|
|
|
QEMU_OBJS_LIB=$(addsuffix .lo,$(basename $(QEMU_OBJS)))
|
libcacard: initial commit
libcacard emulates a Common Access Card (CAC) which is a standard
for smartcards. It is used by the emulated ccid card introduced in
a following patch. Docs are available in docs/libcacard.txt
Signed-off-by: Alon Levy <alevy@redhat.com>
---
changes from v24->v25:
* Fix out of tree builds.
* Fix build with linux-user targets.
changes from v23->v24: (Jes Sorensen review 2)
* Makefile.target: use obj-$(CONFIG_*) +=
* remove unrequired includes, include qemu-common before qemu-thread
* required adding #define NO_NSPR_10_SUPPORT (harmless)
changes from v22->v23:
* configure fixes: (reported by Stefan Hajnoczi)
* test a = b, not a == b (second isn't portable)
* quote $source_path in case it contains spaces
- this doesn't really help since there are many other places
that need similar fixes, not introduced by this patch.
changes from v21->v22:
* fix configure to not link libcacard if nss not found
(reported by Stefan Hajnoczi)
* fix vscclient linkage with simpletrace backend
(reported by Stefan Hajnoczi)
* card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
(reported by William van de Velde)
changes from v20->v21: (Jes Sorensen review)
* use qemu infrastructure: qemu-thread, qemu-common (qemu_malloc
and qemu_free), error_report
* assert instead of ASSERT
* cosmetic fixes
* use strpbrk and isspace
* add --disable-nss --enable-nss here, instead of in the final patch.
* split vscclient, passthru and docs to following patches.
changes from v19->v20:
* checkpatch.pl
changes from v15->v16:
Build:
* don't erase self with distclean
* fix make clean after make distclean
* Makefile: make vscclient link quiet
Behavioral:
* vcard_emul_nss: load coolkey in more situations
* vscclient:
* use hton,ntoh
* send init on connect, only start vevent thread on response
* read payload after header check, before type switch
* remove Reconnect
* update for vscard_common changes, empty Flush implementation
Style/Whitespace:
* fix wrong variable usage
* remove unused variable
* use only C style comments
* add copyright header
* fix tabulation
Signed-off-by: Alon Levy <alevy@redhat.com>
libcacard: fix out of tree builds
2010-11-28 17:36:38 +03:00
|
|
|
|
|
|
|
QEMU_CFLAGS+=-I../
|
|
|
|
|
2011-08-21 07:18:37 +04:00
|
|
|
QEMU_CFLAGS+=$(GLIB_CFLAGS)
|
|
|
|
|
2011-05-15 12:51:28 +04:00
|
|
|
libcacard.lib-y=$(addsuffix .lo,$(basename $(libcacard-y)))
|
|
|
|
|
2011-03-17 17:38:30 +03:00
|
|
|
vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o
|
2011-08-23 00:39:59 +04:00
|
|
|
$(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
|
2011-05-15 12:51:28 +04:00
|
|
|
|
|
|
|
clean:
|
2011-06-27 13:58:20 +04:00
|
|
|
rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la *.pc
|
2011-05-15 12:51:28 +04:00
|
|
|
rm -Rf .libs
|
2011-03-17 17:38:30 +03:00
|
|
|
|
|
|
|
all: vscclient
|
|
|
|
|
2011-05-15 12:51:28 +04:00
|
|
|
#########################################################################
|
|
|
|
# Rules for building libcacard standalone library
|
|
|
|
|
|
|
|
ifeq ($(LIBTOOL),)
|
|
|
|
libcacard.la:
|
|
|
|
@echo "libtool is missing, please install and rerun configure"; exit 1
|
|
|
|
|
|
|
|
install-libcacard:
|
|
|
|
@echo "libtool is missing, please install and rerun configure"; exit 1
|
|
|
|
else
|
|
|
|
libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
|
2011-08-23 00:39:59 +04:00
|
|
|
$(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@")
|
libcacard: initial commit
libcacard emulates a Common Access Card (CAC) which is a standard
for smartcards. It is used by the emulated ccid card introduced in
a following patch. Docs are available in docs/libcacard.txt
Signed-off-by: Alon Levy <alevy@redhat.com>
---
changes from v24->v25:
* Fix out of tree builds.
* Fix build with linux-user targets.
changes from v23->v24: (Jes Sorensen review 2)
* Makefile.target: use obj-$(CONFIG_*) +=
* remove unrequired includes, include qemu-common before qemu-thread
* required adding #define NO_NSPR_10_SUPPORT (harmless)
changes from v22->v23:
* configure fixes: (reported by Stefan Hajnoczi)
* test a = b, not a == b (second isn't portable)
* quote $source_path in case it contains spaces
- this doesn't really help since there are many other places
that need similar fixes, not introduced by this patch.
changes from v21->v22:
* fix configure to not link libcacard if nss not found
(reported by Stefan Hajnoczi)
* fix vscclient linkage with simpletrace backend
(reported by Stefan Hajnoczi)
* card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
(reported by William van de Velde)
changes from v20->v21: (Jes Sorensen review)
* use qemu infrastructure: qemu-thread, qemu-common (qemu_malloc
and qemu_free), error_report
* assert instead of ASSERT
* cosmetic fixes
* use strpbrk and isspace
* add --disable-nss --enable-nss here, instead of in the final patch.
* split vscclient, passthru and docs to following patches.
changes from v19->v20:
* checkpatch.pl
changes from v15->v16:
Build:
* don't erase self with distclean
* fix make clean after make distclean
* Makefile: make vscclient link quiet
Behavioral:
* vcard_emul_nss: load coolkey in more situations
* vscclient:
* use hton,ntoh
* send init on connect, only start vevent thread on response
* read payload after header check, before type switch
* remove Reconnect
* update for vscard_common changes, empty Flush implementation
Style/Whitespace:
* fix wrong variable usage
* remove unused variable
* use only C style comments
* add copyright header
* fix tabulation
Signed-off-by: Alon Levy <alevy@redhat.com>
libcacard: fix out of tree builds
2010-11-28 17:36:38 +03:00
|
|
|
|
2011-06-27 13:58:20 +04:00
|
|
|
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
|
|
|
|
sed -e 's|@LIBDIR@|$(libdir)|' \
|
|
|
|
-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
|
|
|
|
-e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
|
|
|
|
-e 's|@PREFIX@|$(prefix)|' \
|
|
|
|
< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc
|
|
|
|
|
|
|
|
.PHONY: install-libcacard
|
|
|
|
|
|
|
|
install-libcacard: libcacard.pc libcacard.la vscclient
|
2011-05-15 12:51:28 +04:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
|
2011-06-27 13:58:20 +04:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig"
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)"
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
|
2011-08-14 04:30:14 +04:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)"
|
2011-09-02 13:53:26 +04:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.la "$(DESTDIR)$(libdir)"
|
2011-08-14 04:30:14 +04:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
|
2011-06-27 13:58:20 +04:00
|
|
|
for inc in *.h; do \
|
2011-08-14 04:30:14 +04:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
|
2011-06-27 13:58:20 +04:00
|
|
|
done
|
2011-05-15 12:51:28 +04:00
|
|
|
endif
|