-
Notifications
You must be signed in to change notification settings - Fork 19
/
configure
executable file
·330 lines (303 loc) · 10.1 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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
#!/bin/sh
#############################################################################
##
## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation ([email protected])
##
## This file is part of the Qt Components project.
##
## $QT_BEGIN_LICENSE:BSD$
## You may use this file under the terms of the BSD license as follows:
##
## "Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are
## met:
## * Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright
## notice, this list of conditions and the following disclaimer in
## the documentation and/or other materials provided with the
## distribution.
## * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
## the names of its contributors may be used to endorse or promote
## products derived from this software without specific prior written
## permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
## $QT_END_LICENSE$
##
#############################################################################
BUILD_TREE=`/bin/pwd`
SOURCE_TREE=`dirname $0`
SOURCE_TREE=`cd "$SOURCE_TREE"; /bin/pwd`
INSTALL_PREFIX=/usr
BUILD_MEEGO_STYLE=no
BUILD_DEMOS=yes
BUILD_EXAMPLES=yes
BUILD_EXTRAS=yes
BUILD_TESTS=yes
HAVE_MALIIT=no
HAVE_XDAMAGE=no
HAVE_XRANDR=no
HAVE_CONTEXTSUBSCRIBER=no
HAVE_MEEGOGRAPHICSSYSTEM=no
HAVE_THEMEDAEMON_PROTOCOL_V1=yes
FORCE_LOCAL_THEME=no
QMAKE_CONFIG=
QMAKE_DEBUG=
OPT_HELP=no
QMAKE=`which qmake` 2> /dev/null
if [ ! -f "$QMAKE" ]; then
QMAKE=$QTDIR/bin/qmake
if [ ! -f $QMAKE ]; then
echo "ERROR: Unable to find qmake. Try QTDIR=/path/to/qt $0."
exit 1
fi
fi
QMAKE_CACHE=$BUILD_TREE/.qmake.cache
[ -f $QMAKE_CACHE ] && rm -f $QMAKE_CACHE
QMAKEFEATURES=$SOURCE_TREE/features
[ ! -d "$BUILD_TREE/features" ] && mkdir "$BUILD_TREE/features"
CONFIG_PRF="$BUILD_TREE/features/qt-components-config.prf"
[ -f $CONFIG_PRF ] && rm -f $CONFIG_PRF
# Test for pkg-config enabled dependencies
which pkg-config > /dev/null
if [ $? -eq 0 ]; then
pkg-config --exists maliit-1.0 && HAVE_MALIIT=yes
pkg-config --atleast-version=0.5.25 contextsubscriber-1.0 && HAVE_CONTEXTSUBSCRIBER=yes
pkg-config --exists xdamage && HAVE_XDAMAGE=yes
pkg-config --exists xrandr && HAVE_XRANDR=yes
fi
#-------------------------------------------------------------------------------
# parse command line arguments
#-------------------------------------------------------------------------------
# parse the arguments, setting things to "yes" or "no"
while [ "$#" -gt 0 ]; do
CURRENT_OPT="$1"
UNKNOWN_ARG=no
case "$1" in
#Qt style no options
-no-*)
VAR=`echo $1 | sed 's,^-no-\(.*\),\1,'`
VAL=no
;;
#Qt style yes options
-meego|-maliit|-contextsubscriber|-xdamage|-xrandr|-meegographicssystem|-force-local-theme|-mobility)
VAR=`echo $1 | sed 's,^-\(.*\),\1,'`
VAL=yes
;;
-prefix)
VAR=`echo $1 | sed 's,^-\(.*\),\1,'`
shift
VAL="$1"
;;
-*)
VAR=`echo $1 | sed 's,^-\(.*\),\1,'`
VAL=unknown
;;
*)
UNKNOWN_ARG=yes
;;
esac
if [ "$UNKNOWN_ARG" = "yes" ]; then
echo "$1: unknown argument"
OPT_HELP=yes
ERROR=yes
shift
continue
fi
shift
UNKNOWN_OPT=no
case "$VAR" in
prefix)
INSTALL_PREFIX=$VAL
;;
meego)
BUILD_MEEGO_STYLE=yes
;;
force-local-theme)
FORCE_LOCAL_THEME=yes
;;
nomake)
case "$1" in
demos)
BUILD_DEMOS=no
shift
;;
examples)
BUILD_EXAMPLES=no
shift
;;
extras)
BUILD_EXTRAS=no
shift
;;
tests)
BUILD_TESTS=no
shift
;;
*)
CURRENT_OPT="$1"
UNKNOWN_OPT=yes
;;
esac
;;
make)
case "$1" in
demos)
BUILD_DEMOS=yes
;;
examples)
BUILD_EXAMPLES=yes
;;
extras)
BUILD_EXTRAS=yes
;;
tests)
BUILD_TESTS=yes
;;
*)
CURRENT_OPT="$1"
UNKNOWN_OPT=yes
;;
esac
shift
;;
config)
QMAKE_CONFIG="$QMAKE_CONFIG $1"
shift
;;
d)
QMAKE_DEBUG="$QMAKE_DEBUG -d"
;;
# autodetection overrides
maliit)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
HAVE_MALIIT=$VAL
else
UNKNOWN_OPT=yes
fi
;;
contextsubscriber)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
HAVE_CONTEXTSUBSCRIBER=$VAL
else
UNKNOWN_OPT=yes
fi
;;
meegographicssystem)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
HAVE_MEEGOGRAPHICSSYSTEM=$VAL
else
UNKNOWN_OPT=yes
fi
;;
xdamage)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
HAVE_XDAMAGE=$VAL
else
UNKNOWN_OPT=yes
fi
;;
xrandr)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
HAVE_XRANDR=$VAL
else
UNKNOWN_OPT=yes
fi
;;
*)
UNKNOWN_OPT=yes
;;
esac
if [ "$UNKNOWN_OPT" = "yes" ]; then
echo "${CURRENT_OPT}: unknown option"
OPT_HELP=yes
ERROR=yes
fi
done
if [ "$OPT_HELP" = "yes" ]; then
cat << EOF
Usage: configure [-meego] [-config <config>]
[-make <part>] [-nomake <part>] [-help]
Configure options:
-meego ................... Build MeeGo Style
-config (config) ......... Configuration options recognized by qmake
-make (part) ............. Add part to the list of parts to be built at
make time (available parts: demos examples extras tests)
-nomake (part) ........... Exclude part from the list of parts to be built
Additional options:
A plus (+) denotes a default value that needs to be evaluated. If the
evaluation succeeds, the feature is included. Here is a short explanation
of each option:
-no-maliit ............... Do not complile Maliit framework support
+ -maliit .................. Compile Maliit framework support
-no-contextsubscriber .... Do not compile Context Subscriber support
+ -contextsubscriber ....... Compile Context Subscriber support
-no-xdamage .............. Do not compile XDamage support
+ -xdamage ................. Compile XDamage support
-no-meegographicssystem .. Do not compile MeeGo graphics system support
-meegographicssystem ..... Compile MeeGo graphics system support
-no-mobility ............. Do not compile Qt Mobility support
+ -mobility ................ Compile Qt Mobility support
EOF
[ "x$ERROR" = "xyes" ] && exit 1
exit 0
fi
[ "$BUILD_MEEGO_STYLE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG meego"
[ "$BUILD_DEMOS" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG demos"
[ "$BUILD_EXAMPLES" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG examples"
[ "$BUILD_EXTRAS" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG extras"
[ "$BUILD_TESTS" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG tests"
[ "$HAVE_MALIIT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG maliit"
[ "$HAVE_CONTEXTSUBSCRIBER" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG contextsubscriber"
[ "$HAVE_MEEGOGRAPHICSSYSTEM" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG meegographicssystem"
[ "$HAVE_THEMEDAEMON_PROTOCOL_V1" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG themedaemonprotocolv1"
[ "$HAVE_XDAMAGE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG xdamage"
[ "$HAVE_XRANDR" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG xrandr"
[ "$FORCE_LOCAL_THEME" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG force-local-theme"
echo "CONFIG +=$QMAKE_CONFIG" > $CONFIG_PRF
echo "Q_COMPONENTS_SOURCE_TREE = $SOURCE_TREE" > $QMAKE_CACHE
echo "Q_COMPONENTS_BUILD_TREE = $BUILD_TREE" >> $QMAKE_CACHE
echo
echo "Running qmake..."
QMAKEFEATURES=$QMAKEFEATURES $QMAKE $QMAKE_DEBUG -r "CONFIG+=$QMAKE_CONFIG" $SOURCE_TREE/qt-components.pro INSTALL_PREFIX="$INSTALL_PREFIX"
if [ $? != 0 ]; then
echo "ERROR: qmake run failed."
exit 1
fi
echo
echo
echo "Qt Components build configuration:"
echo "Configuration ....................$QMAKE_CONFIG"
echo "MeeGo Style ...................... $BUILD_MEEGO_STYLE"
if [ "$BUILD_MEEGO_STYLE" = "yes" ]; then
echo " Maliit support ................. $HAVE_MALIIT"
echo " ContextSubscriber support ..... $HAVE_CONTEXTSUBSCRIBER"
echo " XDamage support ............... $HAVE_XDAMAGE"
echo " XRandr support ................ $HAVE_XRANDR"
echo " MeeGo Graphics System support .. $HAVE_MEEGOGRAPHICSSYSTEM"
echo " Force local theme .............. $FORCE_LOCAL_THEME"
fi
echo "Extras ........................... $BUILD_EXTRAS"
echo "Demos ............................ $BUILD_DEMOS"
echo "Examples ......................... $BUILD_EXAMPLES"
echo "Tests ............................ $BUILD_TESTS"
echo
if [ "$BUILD_MEEGO_STYLE" = "yes" ]; then
echo "Install prefix: $INSTALL_PREFIX"
echo
fi
echo Qt Components is now configured for building. Just run \'make\'.
echo