-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfigure.sh
200 lines (128 loc) · 4.46 KB
/
configure.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
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
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
#!/bin/sh
set -e
#--------------------------------------------------------------------------------------------------
# Settings
#--------------------------------------------------------------------------------------------------
Sky="../Sky"
external="../3rdparty"
#--------------------------------------------------------------------------------------------------
# environment
compiler_win="mingw"
qt="qt5"
#--------------------------------------------------------------------------------------------------
# Syntax
#--------------------------------------------------------------------------------------------------
if [ $# != 1 -a $# != 2 ] \
|| \
[ $1 != "win32" -a $1 != "win64" -a $1 != "macOS" -a $1 != "linux" -a $1 != "android" ] \
|| \
[ $# = 2 -a "$2" != "clean" ]; then
echo "Usage: configure <win32 | win64 | macOS | linux | android> [clean]"
exit 1
fi
#--------------------------------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------------------------------
external="$external/$1"
if [ $1 = "win32" -o $1 = "win64" ]; then
os="windows"
compiler="$compiler_win"
else
os="default"
compiler="default"
fi
deploy="$Sky/deploy"
#--------------------------------------------------------------------------------------------------
# Clean
#--------------------------------------------------------------------------------------------------
echo "CLEANING"
# NOTE: We want to keep the 'storage' folder.
if [ -d "bin/storage" ]; then
mv bin/storage .
rm -rf bin/*
touch bin/.gitignore
mv storage bin
else
rm -rf bin/*
touch bin/.gitignore
fi
# NOTE: We have to remove the folder to delete .qmake.stash.
rm -rf build
mkdir build
touch build/.gitignore
if [ "$2" = "clean" ]; then
exit 0
fi
#--------------------------------------------------------------------------------------------------
# MinGW
#--------------------------------------------------------------------------------------------------
echo "CONFIGURING MotionBox"
echo "---------------------"
if [ $compiler = "mingw" ]; then
echo "COPYING MinGW"
cp "$deploy"/libgcc_s_*-1.dll bin
cp "$deploy"/libstdc++-6.dll bin
cp "$deploy"/libwinpthread-1.dll bin
fi
#--------------------------------------------------------------------------------------------------
# SSL
#--------------------------------------------------------------------------------------------------
if [ $os = "windows" ]; then
echo "COPYING SSL"
if [ $qt = "qt4" ]; then
cp "$deploy"/libeay32.dll bin
cp "$deploy"/ssleay32.dll bin
else
cp "$deploy"/libssl*.dll bin
cp "$deploy"/libcrypto*.dll bin
fi
fi
#--------------------------------------------------------------------------------------------------
# VLC
#--------------------------------------------------------------------------------------------------
if [ $os = "windows" ]; then
echo "COPYING VLC"
rm -rf bin/plugins
mkdir bin/plugins
cp -r "$deploy"/plugins bin
cp "$deploy"/libvlc*.dll bin
elif [ $1 = "macOS" ]; then
echo "COPYING VLC"
rm -rf bin/plugins
mkdir bin/plugins
cp -r "$deploy"/plugins bin
cp "$deploy"/libvlc*.dylib bin
elif [ $1 = "linux" ]; then
echo "COPYING VLC"
rm -rf bin/vlc
mkdir bin/vlc
cp -r "$deploy"/vlc bin
cp "$deploy"/libvlc*.so* bin
if [ -f "$deploy"/libidn.so* ]; then
cp "$deploy"/libidn.so* bin
fi
fi
#--------------------------------------------------------------------------------------------------
# libtorrent
#--------------------------------------------------------------------------------------------------
if [ $os = "windows" ]; then
echo "COPYING libtorrent"
cp "$deploy"/*torrent-rasterbar.dll bin
elif [ $1 = "macOS" ]; then
echo "COPYING libtorrent"
cp "$deploy"/libtorrent-rasterbar.dylib bin
elif [ $1 = "linux" ]; then
echo "COPYING libtorrent"
cp "$deploy"/libtorrent-rasterbar*.so* bin
fi
#--------------------------------------------------------------------------------------------------
# Boost
#--------------------------------------------------------------------------------------------------
if [ $1 = "macOS" ]; then
echo "COPYING Boost"
cp "$deploy"/libboost*.dylib bin
elif [ $1 = "linux" ]; then
echo "COPYING Boost"
cp "$deploy"/libboost*.so* bin
fi
echo "---------------------"