-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmk.sh
executable file
·36 lines (30 loc) · 835 Bytes
/
mk.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
#!/bin/bash
PYLON_PATH=/opt/pylon5
# HW libs available: /opt/pylon5/lib64/libpylon_TL_{bcon,camemu,gige,usb}.so
libs=(
-lpylonc
-lpylonbase
-lpylon_TL_usb # FIX here for other HW
-lpylonutility
-lGenApi_gcc_v3_1_Basler_pylon
-lGCBase_gcc_v3_1_Basler_pylon
)
CPATH=${PYLON_PATH}/include/
CGO_CPPFLAGS=-I${CPATH}
CGO_LDFLAGS="-L${PYLON_PATH}/lib64 -L. -Wl,--start-group ${libs[@]} -Wl,--end-group"
cmd=test # defaults to test run
if [ -n "$1" ]; then
case "$1" in
-*) ;; # pass flags directly
*) cmd="$1"; shift;; # get first non-flag word as command
esac
fi
set -xe
cd pylon
exec env \
LD_LIBRARY_PATH="${PYLON_PATH}/lib64" \
PYLON_PATH="${PYLON_PATH}" \
CGO_CPPFLAGS="${CGO_CPPFLAGS}" \
CGO_LDFLAGS="${CGO_LDFLAGS}" \
go "$cmd" "$@"
# EOF #