forked from frankmorgner/vsmartcard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pcsc-relay.sh
executable file
·58 lines (48 loc) · 1.41 KB
/
build-pcsc-relay.sh
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
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# CI script to build for "ubuntu", "coverity", "mingw-32", "mingw-64", "macos"
set -ex -o xtrace
pushd pcsc-relay
DEPS="gengetopt help2man automake"
case "$1" in
ubuntu|coverity)
DEPS="$DEPS libnfc-dev libpcsclite-dev"
;;
mingw-32)
DEPS="$DEPS binutils-mingw-w64-i686 gcc-mingw-w64-i686 mingw-w64-i686-dev"
;;
mingw-64)
DEPS="$DEPS binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 mingw-w64-x86-64-dev"
;;
macos)
DEPS="$DEPS libnfc"
;;
esac
case "$1" in
ubuntu|coverity|mingw-32|mingw-64)
sudo apt-get install -y $DEPS
;;
macos)
brew install $DEPS
;;
esac
autoreconf -vis
case "$1" in
ubuntu|coverity|macos)
./configure
;;
mingw-32)
env ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ./configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 CFLAGS=-I/usr/i686-w64-mingw32/include LDFLAGS=-L/usr/i686-w64-mingw32/lib PCSC_LIBS=-lwinscard
;;
mingw-64)
env ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ./configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 CFLAGS=-I/usr/x86_64-w64-mingw32/include LDFLAGS=-L/usr/x86_64-w64-mingw32/lib PCSC_LIBS=-lwinscard
;;
esac
case "$1" in
ubuntu|macos)
make distcheck
;;
mingw-32|mingw-64)
make
;;
esac
popd