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_includedir=$(includedir)/cacard
|
|
|
|
|
2012-05-29 13:40:24 +04:00
|
|
|
$(call set-vpath, $(SRC_PATH))
|
2011-05-15 12:51:28 +04:00
|
|
|
|
|
|
|
# objects linked into a shared library, built with libtool with -fPIC if required
|
2012-05-29 13:40:24 +04:00
|
|
|
QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y)
|
|
|
|
QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(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../
|
|
|
|
|
2012-05-29 13:40:24 +04:00
|
|
|
libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
|
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
|
|
|
|
2012-05-29 13:40:24 +04:00
|
|
|
all: libcacard.la libcacard.pc
|
2011-09-21 11:18:32 +04:00
|
|
|
# Dummy command so that make thinks it has done something
|
|
|
|
@true
|
2011-03-17 17:38:30 +03:00
|
|
|
|
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
|
|
|
|
2012-05-29 13:40:24 +04:00
|
|
|
libcacard_srcpath=$(SRC_PATH)/libcacard
|
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
|