-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexec.sh
executable file
·92 lines (79 loc) · 1.6 KB
/
exec.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
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
#!/bin/sh
if [ "$1" != "mingw64-msys2" ]; then
if [ x$IN0 = x ]; then
export IN0=1
exec stdbuf -oL $0 "$@"
fi
if [ x$IN1 = x ]; then
export IN1=1
exec script -q -e -c "$0 "$@"" ./out.log
fi
fi
ulimit -S -s 32768
ulimit -S -a
ulimit -H -a
if [ -e /etc/environment ]; then
. /etc/environment
fi
CUR=$PWD
if [ "x$1" = "x" ]; then
echo "No target !"
exit 255
fi
echo Current path is $PWD
echo Target is $1
if [ -e /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 ]; then
export LD_PRELOAD=libjemalloc.so.2
fi
if [ -e /usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4 ]; then
export LD_PRELOAD=libtcmalloc_minimal.so.4
fi
echo Running PRE script
$CUR/pre.sh || exit 255
chrt -b --pid 0 $$
renice 3 $$
echo Running Target script
case "$1" in
linux-native)
export LEXLIB=-Wl,--push-state,-Bstatic,-lfl,--pop-state
exec $CUR/native.sh
;;
linux-native-profile)
export LEXLIB=-Wl,--push-state,-Bstatic,-lfl,--pop-state
exec $CUR/native.sh profile
;;
mingw64-win)
exec $CUR/mingw64-n.sh
;;
mingw64-msys2)
exec $CUR/mingw64-ms2.sh
;;
mingw64-cross)
export LEXLIB=-Wl,--push-state,-Bstatic,-lfl,--pop-state
exec $CUR/mingw64.sh
;;
mingw64-legacy-cross)
export LEXLIB=-Wl,--push-state,-Bstatic,-lfl,--pop-state
exec $CUR/mingw64.sh legacy
;;
mingw32-cross)
echo this build is included in mingw64 as multilib/arch now !
exit 0
;;
arm64-cross)
export LEXLIB=-Wl,--push-state,-Bstatic,-lfl,--pop-state
exec $CUR/arm.sh 64
;;
arm32-cross)
export LEXLIB=-Wl,--push-state,-Bstatic,-lfl,--pop-state
exec $CUR/arm.sh 32
;;
musl-cross)
export LEXLIB=-Wl,--push-state,-Bstatic,-lfl,--pop-state
exec $CUR/musl.sh
;;
*)
echo "unknown target !"
exit 255
;;
esac