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 15:36:38 +01:00
|
|
|
-include ../config-host.mak
|
|
|
|
-include $(SRC_PATH)/rules.mak
|
2012-11-19 09:45:06 +01:00
|
|
|
-include $(SRC_PATH)/Makefile.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 15:36:38 +01:00
|
|
|
|
2011-06-27 11:58:20 +02:00
|
|
|
libcacard_includedir=$(includedir)/cacard
|
|
|
|
|
2012-05-29 11:40:24 +02:00
|
|
|
$(call set-vpath, $(SRC_PATH))
|
2011-05-15 10:51:28 +02:00
|
|
|
|
|
|
|
# objects linked into a shared library, built with libtool with -fPIC if required
|
2012-11-19 09:45:20 +01:00
|
|
|
QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) $(stub-obj-y)
|
2012-05-29 11:40:24 +02:00
|
|
|
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 15:36:38 +01:00
|
|
|
|
|
|
|
QEMU_CFLAGS+=-I../
|
|
|
|
|
2012-05-29 11:40:24 +02:00
|
|
|
libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
|
2011-05-15 10:51:28 +02:00
|
|
|
|
2012-10-04 13:09:59 +02:00
|
|
|
vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o cutils.o
|
|
|
|
$(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
|
|
|
|
|
2011-05-15 10:51:28 +02:00
|
|
|
clean:
|
2012-06-10 12:18:54 +02:00
|
|
|
rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc
|
|
|
|
rm -Rf .libs */.libs
|
2011-03-17 15:38:30 +01:00
|
|
|
|
2012-05-29 11:40:24 +02:00
|
|
|
all: libcacard.la libcacard.pc
|
2011-09-21 09:18:32 +02:00
|
|
|
# Dummy command so that make thinks it has done something
|
|
|
|
@true
|
2011-03-17 15:38:30 +01:00
|
|
|
|
2011-05-15 10:51:28 +02: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)
|
2012-12-20 18:32:53 +01:00
|
|
|
$(call quiet-command,$(LIBTOOL) --mode=link --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 15:36:38 +01:00
|
|
|
|
2012-05-29 11:40:24 +02:00
|
|
|
libcacard_srcpath=$(SRC_PATH)/libcacard
|
2011-06-27 11:58:20 +02:00
|
|
|
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
|
2012-06-10 12:18:54 +02:00
|
|
|
$(call quiet-command,sed -e 's|@LIBDIR@|$(libdir)|' \
|
2011-06-27 11:58:20 +02:00
|
|
|
-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
|
|
|
|
-e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
|
|
|
|
-e 's|@PREFIX@|$(prefix)|' \
|
2012-06-10 12:18:54 +02:00
|
|
|
< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc,\
|
|
|
|
" GEN $@")
|
2011-06-27 11:58:20 +02:00
|
|
|
|
|
|
|
.PHONY: install-libcacard
|
|
|
|
|
|
|
|
install-libcacard: libcacard.pc libcacard.la vscclient
|
2011-05-15 10:51:28 +02:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
|
2011-06-27 11:58:20 +02:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig"
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)"
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
|
2011-08-14 02:30:14 +02:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)"
|
2011-09-02 11:53:26 +02:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.la "$(DESTDIR)$(libdir)"
|
2011-08-14 02:30:14 +02:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig"
|
2011-06-27 11:58:20 +02:00
|
|
|
for inc in *.h; do \
|
2011-08-14 02:30:14 +02:00
|
|
|
$(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \
|
2011-06-27 11:58:20 +02:00
|
|
|
done
|
2011-05-15 10:51:28 +02:00
|
|
|
endif
|