Overview
Comment: | Better work towards a Chrome plugin |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7c7e9cf4fc72ec3587bbce88336b6c52 |
User & Date: | rkeene on 2016-02-04 17:36:44 |
Other Links: | manifest | tags |
Context
2016-02-04
| ||
17:50 | Refer to correct PC/SC headers and link to zlib in final target check-in: 88d2f36ad4 user: rkeene tags: trunk | |
17:36 | Better work towards a Chrome plugin check-in: 7c7e9cf4fc user: rkeene tags: trunk | |
2016-02-03
| ||
18:57 | Updated to support building static archives and to check a cache variable regarding PC/SC working check-in: a708a36250 user: rkeene tags: trunk | |
Changes
Modified .fossil-settings/ignore-glob from [e1c6eee148] to [b482ef6532].
︙ | ︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | config.log config.status config.sub configure install-sh libcackey_g.so libcackey.so libcackey.syms build/certs test test-afl test-afl.data build/chrome/archive build/chrome/workdir-* | > > > > > > > | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | config.log config.status config.sub configure install-sh libcackey_g.so libcackey.so libcackey_g.dll libcackey.dll libcackey_g.a libcackey.a libcackey.syms build/certs test test-afl test-afl.data build/chrome/archive build/chrome/workdir-* build/chrome/libcackey.a build/chrome/cackey-chrome.o build/chrome/cackey-chrome.pexe |
Added build/chrome/Makefile version [b979ca24ac].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 40 41 42 43 44 45 46 47 | CC = pnacl-clang CXX = pnacl-clang++ AR = pnacl-ar RANLIB = pnacl-ranlib FINALIZE = pnacl-finalize CACKEY_LIBS = -Llib -lcackey PCSC_LIBS = -Llib -lpcsc -L${NACL_SDK_ROOT}/lib/pnacl/Release -lppapi -lppapi_cpp LIBS = $(CACKEY_LIBS) $(PCSC_LIBS) CFLAGS = -Wall -I${NACL_SDK_ROOT}/include CXXFLAGS = $(CFLAGS) PATH += :${NACL_SDK_ROOT}/toolchain/linux_pnacl/bin export PATH all: cackey.pexe cackey.pexe: cackey-chrome.o cackey-chrome-init.o lib/libcackey.a lib/libpcsc.a $(CXX) -o cackey.pexe.new cackey-chrome.o cackey-chrome-init.o $(LIBS) $(FINALIZE) cackey.pexe.new mv cackey.pexe.new cackey.pexe lib/libcackey.a: build-deps mkdir -p lib rm -f lib/libcackey.a rm -rf workdir-* ./build-deps cd lib && ln -s ../workdir-*.inst/lib/libcackey.a . lib/libpcsc.a: lib/libcackey.a mkdir -p lib rm -f lib/libpcsc.a cd lib && ln -s ../workdir-*.inst/lib/libpcsc.a . cackey-chrome.o: cackey-chrome.c cackey-chrome-init.o: cackey-chrome-init.cc clean: rm -rf workdir-* rm -f lib/libcackey.a lib/libpcsc.a -rmdir lib rm -f cackey-chrome.o cackey-chrome-init.o rm -f cackey.pexe distclean: clean .PHONY: all clean distclean |
Modified build/chrome/build-deps from [f83599ae85] to [cf02f45fdc].
︙ | ︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | if [ ! -d "${NACL_SDK_ROOT}/toolchain" ]; then echo "error: Invalid NACL_SDK_ROOT, not found: ${NACL_SDK_ROOT}/toolchain" >&2 exit 1 fi function download() { local url file hash local hashMethod local chkHash url="$1" file="$2" | > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 50 51 52 53 54 55 56 57 58 59 60 | if [ ! -d "${NACL_SDK_ROOT}/toolchain" ]; then echo "error: Invalid NACL_SDK_ROOT, not found: ${NACL_SDK_ROOT}/toolchain" >&2 exit 1 fi # Setup cross-compiler toolchain ## Set path to include the tools PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/linux_pnacl/bin" export PATH ## Set variables needed by projects HOST_CC="$(which "${CC:-cc}")" BUILD_CC="${HOST_CC}" CC_FOR_BUILD="${HOST_CC}" AR=pnacl-ar AS=pnacl-as LD=pnacl-ld CC=pnacl-clang CXX=pnacl-clang++ RANLIB=pnacl-ranlib STRIP=pnacl-strip OBJCOPY=pnacl-objcopy export HOST_CC BUILD_CC CC_FOR_BUILD AR AS LD CC CXX RANLIB STRIP OBJCOPY ## Set some CFLAGS that the compiler fails to internally set CFLAGS="-I${NACL_SDK_ROOT}/include" CXXFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" export CFLAGS CXXFLAGS CPPFLAGS # Function to download files from the interwebs and verify them function download() { local url file hash local hashMethod local chkHash url="$1" file="$2" |
︙ | ︙ | |||
56 57 58 59 60 61 62 63 64 65 66 67 68 69 | fi mv "${file}.new" "${file}" return 0 } function extract() { local file directory file="$1" directory="$2" if [ ! -f "${file}" ]; then | > > | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | fi mv "${file}.new" "${file}" return 0 } # Extract an archive into a directory, stripping the top-level directory # if that is all that it contains function extract() { local file directory file="$1" directory="$2" if [ ! -f "${file}" ]; then |
︙ | ︙ | |||
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 | ;; *.tar.gz|*.tgz) gzip -dc | tar -xf - || exit 1 ;; *.tar.xz|*.txz) xz -dc | tar -xf - || exit 1 ;; *) echo "error: Don't know what to do with \"${file}\"" >&2 exit 1 ;; esac if [ -d "$(echo *)" ]; then mv */* . >/dev/null 2>/dev/null fi ) < "${file}" || return 1 return 0 } function make() { "${MAKE:-$(which make)}" "$@" } | > > > > > > > | | | | | | < | < < < < < | | | < < < < > | | | | | | < < < < < | < < | | | | | < < | < < < < < < > | | > > < | < | < | < < < | < | < < | > | > > | > < < < > > > > > | | > | < > > < > < < > > | < | > | < | < | < > | | < | < < < > > | | | | | < < < > < < > > < < < > > < > > > | < < < > > < < | < < < | < | < < < | | < < < < < < < < < < < < < < < < < < < < < < | | | > < > > > > > | < < < < | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | ;; *.tar.gz|*.tgz) gzip -dc | tar -xf - || exit 1 ;; *.tar.xz|*.txz) xz -dc | tar -xf - || exit 1 ;; *.zip) cat > x.zip || exit 1 unzip x.zip || exit 1 rm -f x.zip ;; *) echo "error: Don't know what to do with \"${file}\"" >&2 exit 1 ;; esac if [ -d "$(echo *)" ]; then mv */* . >/dev/null 2>/dev/null fi ) < "${file}" || return 1 return 0 } # User-overridable "make" function make() { "${MAKE:-$(which make)}" "$@" } # Build "zlib" function buildZlib() { local version url pkg sha256 configure_extra local archive workdir pkg='zlib' version='1.2.8' url="http://zlib.net/zlib-${version}.tar.gz" sha256='36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d' archive="archive/${pkg}-${version}.tar.gz" workdir="workdir-${RANDOM}${RANDOM}${RANDOM}${RANDOM}.build" download "${url}" "${archive}" "${sha256}" || return 1 extract "${archive}" "${workdir}" || return 1 ( cd "${workdir}" || exit 1 ./configure --prefix=/ --libdir=/lib --static || exit 1 make || exit 1 make DESTDIR="${instdir}" install || exit 1 ) || return 1 rm -rf "${workdir}" return 0 } # Build "boost" function buildBoost() { local version url pkg sha256 configure_extra local archive workdir pkg='boost' version='1.57.0' url="http://downloads.sourceforge.net/project/boost/boost/${version}/boost_`echo ${version} | sed 's_\._\__g'`.tar.bz2" sha256='910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967' archive="archive/${pkg}-${version}.tar.bz2" workdir="workdir-${RANDOM}${RANDOM}${RANDOM}${RANDOM}.build" download "${url}" "${archive}" "${sha256}" || return 1 extract "${archive}" "${workdir}" || return 1 ( cd "${workdir}" || exit 1 ./bootstrap.sh --prefix="${instdir}" --with-python=false --show-libraries ./bootstrap.sh --prefix="${instdir}" --with-python=false --without-libraries='atomic,chrono,container,context,coroutine,date_time,exception,filesystem,graph,graph_parallel,iostreams,locale,log,math,mpi,program_options,python,random,regex,serialization,signals,system,test,thread,timer,wave' || exit 1 echo "using gcc : pnacl : ${CXX} ;" >> project-config.jam ./b2 --debug-configuration toolset=gcc-pnacl target-os=linux link=static runtime-link=static || exit 1 ./bjam install || exit 1 ) || return 1 rm -rf "${workdir}" return 0 } # Build the libpcsc we need function buildPCSC() { local version url pkg sha256 configure_extra local archive workdir buildBoost || return 1 pkg='smart-card-client-c-example-app-sources' version='0.0.0' sha256='68970c6dc4b55d24a453bcfe5768af2b877f553a92a390be7f935db6223d4bc5' archive="archive/${pkg}.zip" workdir="workdir-${RANDOM}${RANDOM}${RANDOM}${RANDOM}.build" extract "${archive}" "${workdir}" || return 1 ( cd "${workdir}" || exit 1 # Copy out PC/SC headers for later use mkdir -p "${instdir}/include/PCSC" || exit 1 cp third_party/pcsc-lite/src/src/PCSC/*.h "${instdir}/include/PCSC" || exit 1 # Copy out JavaScript files for later use mkdir "${instdir}/js" || exit 1 cp third_party/pcsc-lite/client-side/*.js "${instdir}/js" || exit 1 # Build libpcsc ## Assemble all the files into a single tree 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 '{}' third_party/pcsc-lite/client-side/ ';' done ## Create Makefile cat << \_EOF_ > third_party/pcsc-lite/client-side/Makefile || exit 1 CFLAGS += -Wall -std=gnu++11 CXXFLAGS += -Wall -std=gnu++11 CPPFLAGS += -I../src/src/PCSC OBJS = pcsc_nacl.o pcsc_nacl_global.o scard_structs_serialization.o pp_var_utils.o logging.o dom_requests_manager.o all: libpcsc.a libpcsc.a: $(OBJS) rm -f libpcsc.a $(AR) rc libpcsc.a $(OBJS) -$(RANLIB) libpcsc.a 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 pcsc_nacl_global.h: pcsc_nacl.h pp_var_utils.o: pp_var_utils.cc pp_var_utils.h logging.h pp_var_utils.h: logging.h scard_structs_serialization.o: scard_structs_serialization.cc scard_structs_serialization.h pp_var_utils.h scard_structs_serialization.h: pp_var_utils.h dom_requests_manager.o: dom_requests_manager.cc dom_requests_manager.h logging.h pp_var_utils.h logging.o: logging.cc logging.h clean: rm -f $(OBJS) rm -f libpcsc.a distclean: clean .PHONY: all clean distclean _EOF_ ## Make it make -C third_party/pcsc-lite/client-side || exit 1 # Install the built libpcsc mkdir -p "${instdir}/lib" || exit 1 cp third_party/pcsc-lite/client-side/libpcsc.a "${instdir}/lib" || exit 1 ) || return 1 rm -rf "${workdir}" return 0 } # Build our CACKey function buildCACKey() { local platform local file copied local targets buildZlib || return 1 buildPCSC || return 1 ( cd ../.. || exit 1 make distclean ./configure --host=nacl --with-pcsc-libs="-lpcsc" cackey_cv_pcsc_works=okay || exit 1 make || exit 1 ) || return 1 mkdir -p "${instdir}/lib" cp ../../libcackey.a ../../libcackey_g.a "${instdir}/lib" || return 1 return 0 } instdir="workdir-${RANDOM}${RANDOM}${RANDOM}${RANDOM}.inst" rm -rf "${instdir}" mkdir "${instdir}" || exit 1 instdir="$(cd "${instdir}" && pwd)" || exit 1 CFLAGS="${CFLAGS} -I${instdir}/include" CPPFLAGS="${CPPFLAGS} -I${instdir}/include" CXXFLAGS="${CXXFLAGS} -I${instdir}/include" LDFLAGS="${LDFLAGS} -L${instdir}/lib" export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS buildCACKey || exit 1 exit 0 |
Added build/chrome/cackey-chrome-init.cc version [5c1f40635b].
> > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include "ppapi/cpp/module.h" class CACKeyModule : public pp::Module { public: CACKeyModule(): pp::Module() {} virtual ~CACKeyModule() {} virtual pp::Instance *CreateInstance(PP_Instance instance) { return(NULL); } }; namespace pp { Module *CreateModule() { return(NULL); } } |
Added build/chrome/cackey-chrome.c version [5afb8e1152].
> > > > | 1 2 3 4 | void C_GetFunctionList(void); int main(int argc, char **argv) { C_GetFunctionList(); } |
Deleted build/chrome/patches/pcsc-lite-1.8.15-hotplugstaticccid.diff version [856f9b4aaa].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |