-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure
executable file
·249 lines (236 loc) · 8.35 KB
/
configure
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#!/bin/sh
CONFIGURE_OPTIONS="$@"
usage() {
(
echo "Usage: configure [options] [edition name] [QMake options]"
echo ""
echo "Runs QMake to configure the build environment for some pre-defined"
echo "configurations of Tao3D. configure will:"
echo ""
echo " - Select build options (enabling or disabling some features in the program)"
echo " - Select which modules will be built and packaged"
echo " - Select which templates will be included"
echo " - Define some variables related to license generation and checking"
echo ""
echo "Please look at the QMake 'Project MESSAGE' output for detailed information on"
echo "what will be included in the build."
echo ""
echo "Options:"
echo ""
echo " --debug Build in debug mode (default is release)"
echo " -O3,-O4,-Ofast Compiler options to make things faster"
echo " --with-modlic Generate temporary (120-days) licenses for all licensed modules."
echo " --silent Ignored."
echo " --verbose Show all commands spawned by make (do not add CONFIG+=silent)."
echo " --disable-doc Do not build documentation."
echo " --with-eula Enable the End-User License Agreement dialog (REQUIRED for"
echo " official builds)"
echo " --with-updates Check for update on application startup (unless overriden"
echo " in preferences)"
echo " --with-license-download"
echo " Download licenses from license sever (obsolete)"
echo " --with-ccache Use compiler cache. Appends the following qmake flags:"
echo " QMAKE_CC='ccache gcc' QMAKE_CXX='ccache g++'"
echo " --llvm-config Specify which llvm-config to use, in order to select"
echo " the version of LLVM that will be used for code generation"
echo ""
echo "Edition Name:"
echo ""
echo " studio"
echo " <empty> Configure for Tao3D Studio."
echo " Edition is determined at run time, depending on the available licenses"
echo " All default modules except autostereoscopic displays are built and"
echo " packaged, with no license. No application license is bundled."
echo " Without a license, runs In evaluation/demo mode:"
echo " - It shows a watermark (Taodyne logo in the corner)."
echo " - It shows a 'Buy' reminder on exit."
echo " player Configure for the Tao3D Player."
echo " A stripped-down version of Tao3D,"
echo " with no template, no documentation, no SDK, no Web Editor"
echo " Without a license, runs in evaluation/demo mode:"
echo " - It shows a watermark (Taodyne logo in the corner)."
echo " - It shows a 'Buy' reminder on exit."
echo ""
echo "QMake options:"
echo ""
echo " Any other option is passed unmodified to Qmake, after the options added by"
echo " this configure script. Many Tao build options are documented in tao.pro."
echo ""
echo "Examples:"
echo ""
echo " ./configure"
echo " Configure for Tao3D Studio unified build,"
echo " in release mode."
echo " ./configure studio"
echo " Same as the above."
echo " ./configure --debug studio"
echo " Configure for Tao3D Studio unified build,"
echo " in debug mode."
echo " ./configure modules+=+some_module"
echo " Add module some_module to the modules normally selected"
echo " for the unified edition."
echo " Note the two + signs, before and after"
echo " the = sign. The first one means: append to the 'modules'"
echo " variable, do not overwrite it. As a result the module selected"
echo " for the unified edition are in effect and simply modified by the"
echo " option. The second + sign is processed by module_list.pri, see"
echo " this file for details."
echo " ./configure CONFIG+=x86"
echo " Configure for a 32-bit release build on MacOSX (default is 64-bit)"
) >&2
exit 0
}
FLAGS="CONFIG+=release CONFIG+=silent"
VERSION=""
PACKAGE=""
done=
while [ $# -ne 0 ] ; do
case "$1" in
-h|--help)
usage
;;
-release|--release)
#FLAGS="$FLAGS DEFINES+=CFG_WITH_EULA"
#FLAGS="$FLAGS DEFINES+=CFG_WITH_UPDATES"
#FLAGS="$FLAGS DEFINES+=CFG_UNLICENSED_MAX_PAGES=5"
FLAGS="$FLAGS DEFINES+=CFG_NOGIT=1"
shift
;;
-debug|--debug)
FLAGS="$FLAGS CONFIG-=release"
VERSION="-debug"
shift
;;
-O*)
EXTRA="$EXTRA QMAKE_CFLAGS+=$1 QMAKE_CXXFLAGS+=$1 QMAKE_LDFLAGS+=$1"
FLAGS="$FLAGS CONFIG+=release"
VERSION="$1"
shift;;
--with-modlic*)
with_modlic=1
shift
;;
--silent)
shift
;;
--verbose)
FLAGS="$FLAGS CONFIG-=silent"
shift
;;
--disable-doc)
FLAGS="$FLAGS NO_DOC=1"
shift
;;
--with-eula)
FLAGS="$FLAGS DEFINES+=CFG_WITH_EULA"
FLAGS="$FLAGS DEFINES+=CFG_UNLICENSED_MAX_PAGES=5"
shift
;;
--with-updates)
FLAGS="$FLAGS DEFINES+=CFG_WITH_UPDATES"
shift
;;
--with-license-download)
FLAGS="$FLAGS DEFINES+=CFG_LICENSE_DOWNLOAD"
shift
;;
--with-ccache)
with_ccache=1
shift
;;
--xcode)
with_xcode=1
shift
;;
--webkit)
with_webkit=1
shift
;;
--llvm-config|--llvm)
FLAGS="$FLAGS LLVMCONFIG=$2";
shift
shift
;;
design|studio)
shift ; done=1
;;
player)
FLAGS="$FLAGS NO_SDK=1 NO_DOC=1 NO_HELP_VIEWER=1 NO_WELCOME=1"
FLAGS="$FLAGS NO_FONTS=1 TAO_PLAYER=1"
FLAGS="$FLAGS NO_WEBUI=1"
FLAGS="$FLAGS DEFINES+=CFG_NOSRCEDIT DEFINES+=CFG_NOGIT"
FLAGS="$FLAGS DEFINES+=CFG_NONETWORK DEFINES+=CFG_NOEDIT"
FLAGS="$FLAGS DEFINES+=CFG_NO_NEW_FROM_TEMPLATE"
#FLAGS="$FLAGS DEFINES+=CFG_UNLICENSED_MAX_PAGES=5"
FLAGS="$FLAGS templates=none"
PACKAGE="Player"
shift ; done=1
;;
internal)
EDITION=Internal
with_modlic=1
FLAGS="$FLAGS modules=all"
PACKAGE="Internal"
shift ; done=1
;;
*)
done=1
;;
esac
[ "$done" ] && break
done
# Process what was given
FLAGS="$FLAGS PACKAGE_APPEND=$PACKAGE$VERSION"
[ "$with_modlic" ] && FLAGS="$FLAGS SIGN_MODULE_LICENSES=1 LICENSE_VALIDITY=120"
[ "$with_webkit" ] || FLAGS="$FLAGS DEFINES+=CFG_NO_QTWEBKIT NO_HELP_VIEWER=1"
# Default QMake flags for each OS
osflags() {
UNAME=`uname`
case "$UNAME" in
Darwin)
if [ "$with_xcode" ]; then
echo "-spec macx-xcode"
else
echo "-spec macx-clang QMAKE_CXXFLAGS+=-Qunused-arguments"
fi
;;
MINGW*)
echo "-spec win32-g++"
;;
Linux*)
echo ""
;;
esac
}
# Select name of qmake
QMAKE=qmake
qmake-qt4 --version > /dev/null 2>&1 && QMAKE=qmake-qt4
qmake-qt5 --version > /dev/null 2>&1 && QMAKE=qmake-qt5
QT_VERSION=$($QMAKE -query QT_VERSION)
case $QT_VERSION in
5*)
# Make sure we don't inherit old settings via qmake cache
echo > .qmake.cache
;;
esac
echo "/* Generated by ./configure */" >config.h
echo "#define CONFIGURE_OPTIONS \"$CONFIGURE_OPTIONS\"" >>config.h
(cd libxlr/xlr/recorder && make config.h) && \
cat libxlr/xlr/recorder/config.h >> config.h
echo Running: $QMAKE -r `osflags` $FLAGS "$CCACHE_FLAGS" "$CCACHE_CC" "$CCACHE_CXX" "$@"
if [ "$with_ccache" ] ; then
$QMAKE -r `osflags` $FLAGS QMAKE_CXX='ccache g++' QMAKE_CC='ccache gcc' $EXTRA "$@"
else
$QMAKE -r `osflags` $FLAGS $EXTRA "$@"
fi
if [ "$?" != "0" ]; then
echo "It looks like configuration failed. You may need additional packages."
if apt-get --version > /dev/null 2>&1 ; then
echo "sudo apt-get install llvm-3.4-dev libqt5svg5-dev libqt5webkit5-dev libqt5help5 libqt5opengl5-dev qttools5-dev qttools5-dev-tools doxygen festival festival-dev libxss-dev nodejs npm libvlc-dev libvlccore-dev curl"
echo "(cd /usr/bin; sudo ln -s nodejs node; sudo ln -s llvm-config-3.4 llvm-config)"
elif dnf --version > /dev/null 2>&1 ; then
echo "sudo dnf install gcc-c++ libGLU-devel libXScrnSaver-devel alsa-lib-devel qt5-devel llvm35-devel llvm35-static festival-devel vlc-devel nodejs npm"
elif brew --version > /dev/null 2>&1 ; then
echo "brew install qt5 [email protected] vlc nodejs"
fi
fi