NaCl libpcsc

Check-in [6d016db860]
Login

Check-in [6d016db860]

Overview
Comment:We now build a mostly complete libpcsc.a, though with no way to initialize it (since we have not discovered how to do that in this release of Google's code yet
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6d016db86015232c105f75ccebfca6ea1fc7584f
User & Date: rkeene on 2016-04-14 00:54:47.748
Other Links: manifest | tags
Context
2016-04-14
02:28
More work towards something possibly usable one day check-in: 3dc3a3b281 user: rkeene tags: trunk
00:54
We now build a mostly complete libpcsc.a, though with no way to initialize it (since we have not discovered how to do that in this release of Google's code yet check-in: 6d016db860 user: rkeene tags: trunk
2016-04-13
22:13
Better targets check-in: 60c7795ca7 user: rkeene tags: trunk
Changes
Modified Makefile from [7ceeb916bb] to [5d97a5aa96].
21
22
23
24
25
26
27
28
29


30
31
32
33
34
35
36
37
38
39
40


41
42
43
44
45
46
47
21
22
23
24
25
26
27


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49







-
-
+
+











+
+







CFLAGS       := -I${NACL_SDK_ROOT}/include
CXXFLAGS     := $(CFLAGS)
CPPFLAGS     := $(CFLAGS)
export CFLAGS CXXFLAGS CPPFLAGS

all: libpcsc.a

libpcsc.a: pcsc/Makefile pcsc/pcsc-nacl.h pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f)
	$(MAKE) -C pcsc
libpcsc.a: pcsc/Makefile pcsc/pcsc-nacl.h pcsc/pcsc_nacl_init.cc $(shell find pcsc/src -type f) boost
	$(MAKE) -C pcsc BOOST_DIR='$(shell pwd)/boost'
	cp pcsc/libpcsc.a libpcsc.a.new
	mv libpcsc.a.new libpcsc.a

boost: build-boost
	rm -rf boost
	./build-boost

clean:
	$(MAKE) -C pcsc clean
	rm -f libpcsc.a
	rm -f libpcsc.a.new
	rm -rf workdir-*
	rm -rf boost.new

distclean: clean
	rm -rf boost
	$(MAKE) -C pcsc distclean

mrproper: distclean
	rm -rf pcsc/src
38
39
40
41
42
43
44























































45
46
47












48

49
50
51
52
53
54
55
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+

+








		# Copy out JavaScript files for later use
		mkdir "${instdir}/js" || exit 1
#		cp common-utils/*.js "${instdir}/js" || exit 1
#		cp third_party/pcsc-lite/client-side/*.js "${instdir}/js" || exit 1

		# Assemble all the files into a single tree
		files=(
			common/cpp/src/google_smart_card_common/formatting.h
			common/cpp/src/google_smart_card_common/logging/function_call_tracer.cc
			common/cpp/src/google_smart_card_common/logging/function_call_tracer.h
			common/cpp/src/google_smart_card_common/logging/hex_dumping.cc
			common/cpp/src/google_smart_card_common/logging/hex_dumping.h
			common/cpp/src/google_smart_card_common/logging/logging.cc
			common/cpp/src/google_smart_card_common/logging/logging.h
			common/cpp/src/google_smart_card_common/logging/mask_dumping.h
			common/cpp/src/google_smart_card_common/messaging/message_listener.h
			common/cpp/src/google_smart_card_common/messaging/typed_message.cc
			common/cpp/src/google_smart_card_common/messaging/typed_message.h
			common/cpp/src/google_smart_card_common/messaging/typed_message_listener.h
			common/cpp/src/google_smart_card_common/messaging/typed_message_router.cc
			common/cpp/src/google_smart_card_common/messaging/typed_message_router.h
			common/cpp/src/google_smart_card_common/multi_string.cc
			common/cpp/src/google_smart_card_common/multi_string.h
			common/cpp/src/google_smart_card_common/numeric_conversions.cc
			common/cpp/src/google_smart_card_common/numeric_conversions.h
			common/cpp/src/google_smart_card_common/optional.h
			common/cpp/src/google_smart_card_common/pp_var_utils/construction.cc
			common/cpp/src/google_smart_card_common/pp_var_utils/construction.h
			common/cpp/src/google_smart_card_common/pp_var_utils/copying.cc
			common/cpp/src/google_smart_card_common/pp_var_utils/copying.h
			common/cpp/src/google_smart_card_common/pp_var_utils/debug_dump.cc
			common/cpp/src/google_smart_card_common/pp_var_utils/debug_dump.h
			common/cpp/src/google_smart_card_common/pp_var_utils/extraction.cc
			common/cpp/src/google_smart_card_common/pp_var_utils/extraction.h
			common/cpp/src/google_smart_card_common/pp_var_utils/operations.h
			common/cpp/src/google_smart_card_common/pp_var_utils/struct_converter.h
			common/cpp/src/google_smart_card_common/requesting/async_request.cc
			common/cpp/src/google_smart_card_common/requesting/async_request.h
			common/cpp/src/google_smart_card_common/requesting/async_requests_storage.cc
			common/cpp/src/google_smart_card_common/requesting/async_requests_storage.h
			common/cpp/src/google_smart_card_common/requesting/js_requester.cc
			common/cpp/src/google_smart_card_common/requesting/js_requester.h
			common/cpp/src/google_smart_card_common/requesting/remote_call_adaptor.cc
			common/cpp/src/google_smart_card_common/requesting/remote_call_adaptor.h
			common/cpp/src/google_smart_card_common/requesting/remote_call_message.cc
			common/cpp/src/google_smart_card_common/requesting/remote_call_message.h
			common/cpp/src/google_smart_card_common/requesting/request_id.h
			common/cpp/src/google_smart_card_common/requesting/request_result.cc
			common/cpp/src/google_smart_card_common/requesting/request_result.h
			common/cpp/src/google_smart_card_common/requesting/requester.cc
			common/cpp/src/google_smart_card_common/requesting/requester.h
			common/cpp/src/google_smart_card_common/requesting/requester_message.cc
			common/cpp/src/google_smart_card_common/requesting/requester_message.h
			common/cpp/src/google_smart_card_common/thread_safe_unique_ptr.h
			common/cpp/src/google_smart_card_common/unique_ptr_utils.h
			third_party/pcsc-lite/naclport/common/src/google_smart_card_pcsc_lite_common/pcsc_lite.h
			third_party/pcsc-lite/naclport/common/src/google_smart_card_pcsc_lite_common/pcsc_lite_tracing_wrapper.cc
			third_party/pcsc-lite/naclport/common/src/google_smart_card_pcsc_lite_common/pcsc_lite_tracing_wrapper.h
			third_party/pcsc-lite/naclport/common/src/google_smart_card_pcsc_lite_common/scard_debug_dump.cc
			third_party/pcsc-lite/naclport/common/src/google_smart_card_pcsc_lite_common/scard_debug_dump.h
			third_party/pcsc-lite/naclport/common/src/google_smart_card_pcsc_lite_common/scard_structs_serialization.cc
		for file in logging.h scard_structs_serialization.h dom_requests_manager.h thread_safe_string_pool.h \
		    pp_var_utils.cc pp_var_utils.h scard_structs_serialization.cc dom_requests_manager.cc logging.cc; do
			find . -type f -name "${file}" -exec cp '{}' "${instdir}" ';'
			third_party/pcsc-lite/naclport/common/src/google_smart_card_pcsc_lite_common/scard_structs_serialization.h
			third_party/pcsc-lite/naclport/cpp_client/src/google_smart_card_pcsc_lite_client/global.cc
			third_party/pcsc-lite/naclport/cpp_client/src/google_smart_card_pcsc_lite_client/global.h
			third_party/pcsc-lite/naclport/cpp_client/src/pcsc_lite_over_requester.cc
			third_party/pcsc-lite/naclport/cpp_client/src/pcsc_lite_over_requester.h
			third_party/pcsc-lite/src-1.8.15/src/error.c
		)

		for file in "${files[@]}"; do
			instfile="${instdir}/$(basename "${file}")"

			sed 's@<google_smart_card_pcsc_lite_client/*.*/@<@;s@<google_smart_card_common/*.*/@<@;s@<google_smart_card_pcsc_lite_common/*.*/@<@;/#include "config.h"/ d;s@#include "misc.h"@#include "winscard.h"@' "${file}" > "${instfile}" || exit 1
		done

	) || return 1

	rm -rf "${workdir}"

	return 0
}


1
2
3



4

5

6
7


8
9
10
11
12
13
14
15


16
17
18
19

20

21
22
23
24


25
26
27

28
29

30


31
32
33
34

35
36

37
38
1



2
3
4
5
6

7
8
9
10
11
12
13
14
15
16
17


18
19


20

21

22
23



24
25



26


27

28
29
30
31
32
33
34
35
36
37
38
39
+
-
-
-
+
+
+

+
-
+


+
+






-
-
+
+
-
-

-
+
-
+

-
-
-
+
+
-
-
-
+
-
-
+
-
+
+




+


+


BOOST_DIR := /usr/include/boost
CFLAGS   += -Wall -std=gnu++11 -g3 -ggdb3
CXXFLAGS += -Wall -std=gnu++11 -g3 -ggdb3
CPPFLAGS += -I../src/src/PCSC
CFLAGS    += -Wall -std=gnu11 -g3 -ggdb3
CXXFLAGS  += -Wall -std=gnu++11 -g3 -ggdb3
CPPFLAGS  += -Isrc/include/PCSC -isystem $(BOOST_DIR)/include -Isrc -isystem $(NACL_SDK_ROOT)/include

OBJS += 
OBJS = pcsc_nacl.o pcsc_nacl_global.o scard_structs_serialization.o pp_var_utils.o logging.o dom_requests_manager.o pcsc_nacl_init.o
# pcsc_nacl_init.o

all: libpcsc.a

include Makefile.deps

libpcsc.a: $(OBJS)
	rm -f libpcsc.a
	$(AR) rc libpcsc.a $(OBJS)
	-$(RANLIB) libpcsc.a

pcsc_nacl_init.o: pcsc_nacl_init.cc pcsc_nacl_global.h dom_requests_manager.h pcsc_nacl.h

%.o: src/%.cc
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o "$@" $(filter %.cc,$^)
pcsc_nacl.o: pcsc_nacl.cc pcsc_nacl.h logging.h pp_var_utils.h scard_structs_serialization.h
pcsc_nacl.h: dom_requests_manager.h thread_safe_string_pool.h

pcsc_nacl_global.o: pcsc_nacl_global.cc pcsc_nacl_global.h logging.h
%.o: src/%.c
pcsc_nacl_global.h: pcsc_nacl.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o "$@" $(filter %.c,$^)

pp_var_utils.o: pp_var_utils.cc pp_var_utils.h logging.h
pp_var_utils.h: logging.h

Makefile.deps:
	rm -f Makefile.deps.new
scard_structs_serialization.o: scard_structs_serialization.cc scard_structs_serialization.h pp_var_utils.h
scard_structs_serialization.h: pp_var_utils.h

	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM src/*.cc > Makefile.deps.new
dom_requests_manager.o: dom_requests_manager.cc dom_requests_manager.h logging.h pp_var_utils.h

	$(CC) $(CFLAGS) $(CPPFLAGS) -MM src/*.c >> Makefile.deps.new
logging.o: logging.cc logging.h
	grep ': ' Makefile.deps.new | cut -f 1 -d : | sed 's@^@OBJS += @' >> Makefile.deps.new
	mv Makefile.deps.new Makefile.deps

clean:
	rm -f $(OBJS)
	rm -f libpcsc.a
	rm -f Makefile.deps.new

distclean: clean
	rm -f Makefile.deps

.PHONY: all clean distclean