forked from omega-gg/MotionBox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.sh
185 lines (128 loc) · 4.84 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
#!/bin/sh
set -e
#--------------------------------------------------------------------------------------------------
# Settings
#--------------------------------------------------------------------------------------------------
Sky="../Sky"
external="../3rdparty"
#--------------------------------------------------------------------------------------------------
SSL_versionA="1.0.2p"
SSL_versionB="1.1.1d"
VLC_version="3.0.10"
#--------------------------------------------------------------------------------------------------
# Windows
MinGW_version="7.3.0"
#--------------------------------------------------------------------------------------------------
# Syntax
#--------------------------------------------------------------------------------------------------
if [ $# != 2 -a $# != 3 ] \
|| \
[ $1 != "qt4" -a $1 != "qt5" -a $1 != "clean" ] \
|| \
[ $2 != "win32" -a $2 != "win64" -a $2 != "win32-msvc" -a $2 != "win64-msvc" -a \
$2 != "macOS" -a $2 != "linux" -a $2 != "android" ] \
|| \
[ $# = 3 -a "$3" != "sky" ]; then
echo "Usage: configure <qt4 | qt5 | clean>"
echo " <win32 | win64 | win32-msvc | win64-msvc | macOS | linux | android>"
echo " [sky]"
exit 1
fi
#--------------------------------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------------------------------
external="$external/$2"
if [ $2 = "win32" -o $2 = "win64" -o $2 = "win32-msvc" -o $2 = "win64-msvc" ]; then
os="windows"
if [ $2 = "win32" -o $2 = "win64" ]; then
compiler="mingw"
MinGW="$external/MinGW/$MinGW_version/bin"
else
compiler="default"
fi
else
os="default"
compiler="default"
fi
#--------------------------------------------------------------------------------------------------
if [ $1 = "qt4" ]; then
SSL="$external/OpenSSL/$SSL_versionA"
else
SSL="$external/OpenSSL/$SSL_versionB"
fi
VLC="$external/VLC/$VLC_version"
#--------------------------------------------------------------------------------------------------
# Clean
#--------------------------------------------------------------------------------------------------
echo "CLEANING"
rm -rf lib
mkdir lib
touch lib/.gitignore
rm -rf bin/*
touch bin/.gitignore
# NOTE: We have to remove the folder to delete .qmake.stash.
rm -rf build
mkdir build
touch build/.gitignore
if [ $1 = "clean" ]; then
exit 0
fi
#--------------------------------------------------------------------------------------------------
# Sky
#--------------------------------------------------------------------------------------------------
if [ "$3" = "sky" ]; then
echo "CONFIGURING Sky"
echo "---------------"
cd "$Sky"
sh configure.sh $1 $2
cd -
echo "---------------"
echo ""
fi
#--------------------------------------------------------------------------------------------------
# MinGW
#--------------------------------------------------------------------------------------------------
echo "CONFIGURING MotionBox"
echo "---------------------"
if [ $compiler = "mingw" ]; then
cp "$MinGW"/libgcc_s_*-1.dll bin
cp "$MinGW"/libstdc++-6.dll bin
cp "$MinGW"/libwinpthread-1.dll bin
fi
#--------------------------------------------------------------------------------------------------
# SSL
#--------------------------------------------------------------------------------------------------
if [ $os = "windows" ]; then
echo "COPYING SSL"
cp "$SSL"/*.dll bin
fi
#--------------------------------------------------------------------------------------------------
# VLC
#--------------------------------------------------------------------------------------------------
if [ $os = "windows" ]; then
echo "COPYING VLC"
rm -rf bin/plugins
mkdir bin/plugins
cp -r "$VLC"/plugins/access bin/plugins
cp -r "$VLC"/plugins/audio_filter bin/plugins
cp -r "$VLC"/plugins/audio_mixer bin/plugins
cp -r "$VLC"/plugins/audio_output bin/plugins
cp -r "$VLC"/plugins/codec bin/plugins
cp -r "$VLC"/plugins/control bin/plugins
cp -r "$VLC"/plugins/demux bin/plugins
cp -r "$VLC"/plugins/misc bin/plugins
cp -r "$VLC"/plugins/packetizer bin/plugins
cp -r "$VLC"/plugins/stream_filter bin/plugins
cp -r "$VLC"/plugins/stream_out bin/plugins
cp -r "$VLC"/plugins/video_chroma bin/plugins
cp -r "$VLC"/plugins/video_filter bin/plugins
cp -r "$VLC"/plugins/video_output bin/plugins
cp "$VLC"/libvlc*.dll bin
elif [ $2 = "macOS" ]; then
rm -rf bin/plugins
mkdir bin/plugins
cp -r "$VLC"/plugins/*.dylib bin/plugins
cp "$VLC"/lib/libvlc.5.dylib bin/libvlc.dylib
cp "$VLC"/lib/libvlccore.9.dylib bin/libvlccore.dylib
fi
echo "---------------------"