56 # as an example $2 might have value "maemo5". |
56 # as an example $2 might have value "maemo5". |
57 # This is required because when building in scratchbox for |
57 # This is required because when building in scratchbox for |
58 # maemo we do not want to follow symbolic links that are |
58 # maemo we do not want to follow symbolic links that are |
59 # introduced by scratchbox |
59 # introduced by scratchbox |
60 absPath() { |
60 absPath() { |
61 |
|
62 if [ "$2" = "maemo5" -o "$2" = "maemo6" ]; then |
61 if [ "$2" = "maemo5" -o "$2" = "maemo6" ]; then |
63 if [ `isAbsPath $1` = '1' ]; then |
62 if [ `isAbsPath $1` = '1' ]; then |
64 echo $1; |
63 echo $1; |
65 else |
64 else |
66 echo "Relative prefix paths are not supported for Maemo" |
65 echo >&2 "Relative prefix/bin/lib/header/plugin paths are not supported for Maemo" |
67 exit 1; |
66 exit 1; |
68 fi |
67 fi |
69 else |
68 else |
70 RESULT=`(cd "$1"; /bin/pwd)` |
69 PATH=`$relpath/bin/pathhelper $1` |
71 echo $RESULT |
70 echo $PATH |
72 fi |
71 fi |
73 } |
72 } |
74 |
73 |
75 |
74 |
76 # the current directory (shadow build dir) |
75 # the current directory (shadow build dir) |
84 CONFIG_IN="$shadowpath/config.in" |
83 CONFIG_IN="$shadowpath/config.in" |
85 QT_MOBILITY_PREFIX=$shadowpath/install |
84 QT_MOBILITY_PREFIX=$shadowpath/install |
86 QT_MOBILITY_INCLUDE= |
85 QT_MOBILITY_INCLUDE= |
87 QT_MOBILITY_LIB= |
86 QT_MOBILITY_LIB= |
88 QT_MOBILITY_BIN= |
87 QT_MOBILITY_BIN= |
|
88 QT_MOBILITY_PLUGINS= |
89 BUILD_UNITTESTS= |
89 BUILD_UNITTESTS= |
90 BUILD_EXAMPLES= |
90 BUILD_EXAMPLES= |
91 BUILD_DOCS=yes |
91 BUILD_DOCS=yes |
92 BUILD_TOOLS=yes |
92 BUILD_TOOLS=yes |
93 RELEASEMODE= |
93 RELEASEMODE= |
94 BUILD_SILENT= |
94 BUILD_SILENT= |
95 LINUX_TARGET= |
95 LINUX_TARGET= |
96 QMAKE_CACHE="$shadowpath/.qmake.cache" |
96 QMAKE_CACHE="$shadowpath/.qmake.cache" |
97 LIB_PATH="lib" |
97 LIB_PATH="lib" |
98 BIN_PATH="bin" |
98 BIN_PATH="bin" |
|
99 PLUGIN_PATH="plugins" |
99 MAC_SDK= |
100 MAC_SDK= |
100 MOBILITY_MODULES="bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors" |
101 MOBILITY_MODULES="bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors" |
101 MOBILITY_MODULES_UNPARSED= |
102 MOBILITY_MODULES_UNPARSED= |
|
103 QMKSPEC= |
|
104 OS="other" |
102 |
105 |
103 usage() |
106 usage() |
104 { |
107 { |
105 echo "Usage: configure [-prefix <dir>] [headerdir <dir>] [libdir <dir>]" |
108 echo "Usage: configure [-prefix <dir>] [headerdir <dir>] [libdir <dir>]" |
106 echo " [-bindir <dir>] [-tests] [-examples] [-no-docs]" |
109 echo " [-bindir <dir>] [-tests] [-examples] [-no-docs]" |
115 echo " (default prefix: PREFIX/include)" |
118 echo " (default prefix: PREFIX/include)" |
116 echo "-libdir <dir> ..... Libraries will be installed to <dir>" |
119 echo "-libdir <dir> ..... Libraries will be installed to <dir>" |
117 echo " (default PREFIX/lib)" |
120 echo " (default PREFIX/lib)" |
118 echo "-bindir <dir> ..... Executables will be installed to <dir>" |
121 echo "-bindir <dir> ..... Executables will be installed to <dir>" |
119 echo " (default PREFIX/bin)" |
122 echo " (default PREFIX/bin)" |
|
123 echo "-plugindir <dir> .. Plug-ins will be installed to <dir>" |
|
124 echo " (default PREFIX/plugins)" |
120 echo "-debug ............ Build with debugging symbols" |
125 echo "-debug ............ Build with debugging symbols" |
121 echo "-release .......... Build without debugging symbols" |
126 echo "-release .......... Build without debugging symbols" |
122 echo "-silent ........... Reduces build output" |
127 echo "-silent ........... Reduces build output" |
123 echo "-tests ............ Build unit tests (not build by default)" |
128 echo "-tests ............ Build unit tests (not build by default)" |
124 echo " Note, this adds test symbols to all libraries" |
129 echo " Note, this adds test symbols to all libraries" |
230 ;; |
239 ;; |
231 esac |
240 esac |
232 shift |
241 shift |
233 done |
242 done |
234 |
243 |
|
244 checkostype() |
|
245 { |
|
246 match="darwin" |
|
247 if [ "$OSTYPE" = "${match}"* ]; then |
|
248 OS="darwin" |
|
249 QMKSPEC="-spec macx-g++" |
|
250 echo "QMAKESPEC = "$QMKSPEC >> "$CONFIG_IN" |
|
251 fi |
|
252 } |
|
253 |
235 findframeworks() |
254 findframeworks() |
236 { |
255 { |
237 # figure out if Qt was built with frameworks |
256 # figure out if Qt was built with frameworks |
238 # if so, install in the correct place. |
257 # if so, install in the correct place. |
239 # and fix rpath |
258 # and fix rpath |
240 echo "contains(QT_CONFIG,qt_framework):message(1)" > 1.pro |
259 echo "contains(QT_CONFIG,qt_framework):message(1)" > 1.pro |
241 SOMETHING=`qmake 1.pro 2>&1` |
260 SOMETHING=`qmake -spec macx-g++ 1.pro 2>&1` |
242 if [ "$SOMETHING" = "Project MESSAGE: 1" ]; then |
261 if [ "$SOMETHING" = "Project MESSAGE: 1" ]; then |
243 LIB_PATH="Library/Frameworks" |
262 LIB_PATH="Library/Frameworks" |
244 BIN_PATH="Applications" |
263 BIN_PATH="Applications" |
245 fi |
264 fi |
246 rm 1.pro |
265 rm 1.pro |
247 } |
266 } |
248 |
267 |
249 findframeworks |
|
250 |
268 |
251 findUniversal() |
269 findUniversal() |
252 { |
270 { |
253 if [ -e "mac.inc" ]; then |
271 if [ -e "mac.inc" ]; then |
254 rm mac.inc |
272 rm mac.inc |
255 fi |
273 fi |
256 echo "contains(QT_CONFIG,x86): system(echo CONFIG+=x86 >> mac.inc)" > 2.pro |
274 echo "contains(QT_CONFIG,x86): system(echo CONFIG+=x86 >> mac.inc)" > 2.pro |
257 echo "contains(QT_CONFIG,ppc): system(echo CONFIG+=ppc >> mac.inc)" >> 2.pro |
275 echo "contains(QT_CONFIG,ppc): system(echo CONFIG+=ppc >> mac.inc)" >> 2.pro |
258 echo "contains(QT_CONFIG,ppc64): system(echo CONFIG+=ppc64 >> mac.inc)" >> 2.pro |
276 echo "contains(QT_CONFIG,ppc64): system(echo CONFIG+=ppc64 >> mac.inc)" >> 2.pro |
259 echo "contains(QT_CONFIG,x86_64): system(echo CONFIG+=x86_64 >> mac.inc)" >> 2.pro |
277 echo "contains(QT_CONFIG,x86_64): system(echo CONFIG+=x86_64 >> mac.inc)" >> 2.pro |
260 SOMETIME=`qmake 2.pro 2>&1` |
278 SOMETIME=`qmake -spec macx-g++ 2.pro 2>&1` |
261 rm 2.pro |
279 rm 2.pro |
262 if [ -e "mac.inc" ]; then |
280 if [ -e "mac.inc" ]; then |
263 echo "exists(mac.inc): include(mac.inc)" >> "$CONFIG_IN" |
281 echo "exists(mac.inc): include(mac.inc)" >> "$CONFIG_IN" |
264 fi |
282 fi |
265 } |
283 } |
266 |
284 |
|
285 checkostype |
|
286 |
|
287 if [ "$OS" = "darwin" ] ; then |
|
288 findframeworks |
|
289 fi |
267 |
290 |
268 if [ -n "$BUILD_SILENT" ]; then |
291 if [ -n "$BUILD_SILENT" ]; then |
269 echo "CONFIG += silent" > "$CONFIG_IN" |
292 echo "CONFIG += silent" > "$CONFIG_IN" |
270 fi |
293 fi |
271 |
294 |
272 findUniversal |
295 if [ "$OS" = "darwin" ] ; then |
|
296 findUniversal |
|
297 fi |
273 |
298 |
274 if [ -z "$RELEASEMODE" ]; then |
299 if [ -z "$RELEASEMODE" ]; then |
275 RELEASEMODE="debug" |
300 RELEASEMODE="debug" |
276 fi |
301 fi |
277 echo "CONFIG += $RELEASEMODE" >> "$CONFIG_IN" |
302 echo "CONFIG += $RELEASEMODE" >> "$CONFIG_IN" |
284 echo "CONFIG+=maemo6" >> "$CONFIG_IN" |
309 echo "CONFIG+=maemo6" >> "$CONFIG_IN" |
285 fi |
310 fi |
286 fi |
311 fi |
287 |
312 |
288 #process PREFIX |
313 #process PREFIX |
289 if [ -d "$QT_MOBILITY_PREFIX" ]; then |
314 QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET` |
290 QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET` |
315 if [ "$?" -eq "1" ]; then |
291 else |
316 exit 1 |
292 mkdir -p "$QT_MOBILITY_PREFIX" |
|
293 QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET` |
|
294 rm -rf "$QT_MOBILITY_PREFIX" |
|
295 fi |
317 fi |
296 echo "QT_MOBILITY_PREFIX = $QT_MOBILITY_PREFIX" >> "$CONFIG_IN" |
318 echo "QT_MOBILITY_PREFIX = $QT_MOBILITY_PREFIX" >> "$CONFIG_IN" |
297 |
319 |
298 #process include path |
320 #process include path |
299 if [ -z "$QT_MOBILITY_INCLUDE" ]; then |
321 if [ -z "$QT_MOBILITY_INCLUDE" ]; then |
300 QT_MOBILITY_INCLUDE="$QT_MOBILITY_PREFIX/include" |
322 QT_MOBILITY_INCLUDE="$QT_MOBILITY_PREFIX/include" |
301 elif [ -d "$QT_MOBILITY_INCLUDE" ]; then |
323 else |
302 QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET` |
324 QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET` |
303 else |
325 if [ "$?" -eq "1" ]; then |
304 mkdir -p "$QT_MOBILITY_INCLUDE" |
326 exit 1 |
305 QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET` |
327 fi |
306 rm -rf "$QT_MOBILITY_INCLUDE" |
|
307 fi |
328 fi |
308 echo "QT_MOBILITY_INCLUDE = $QT_MOBILITY_INCLUDE" >> "$CONFIG_IN" |
329 echo "QT_MOBILITY_INCLUDE = $QT_MOBILITY_INCLUDE" >> "$CONFIG_IN" |
309 |
330 |
310 |
331 |
311 #process library path |
332 #process library path |
312 if [ -z "$QT_MOBILITY_LIB" ]; then |
333 if [ -z "$QT_MOBILITY_LIB" ]; then |
313 QT_MOBILITY_LIB="$QT_MOBILITY_PREFIX/$LIB_PATH" |
334 QT_MOBILITY_LIB="$QT_MOBILITY_PREFIX/$LIB_PATH" |
314 elif [ -d "$QT_MOBILITY_LIB" ]; then |
335 else |
315 QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET` |
336 QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET` |
316 else |
337 if [ "$?" -eq "1" ]; then |
317 mkdir -p "$QT_MOBILITY_LIB" |
338 exit 1 |
318 QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET` |
339 fi |
319 rm -rf "$QT_MOBILITY_LIB" |
|
320 fi |
340 fi |
321 echo "QT_MOBILITY_LIB = $QT_MOBILITY_LIB" >> "$CONFIG_IN" |
341 echo "QT_MOBILITY_LIB = $QT_MOBILITY_LIB" >> "$CONFIG_IN" |
322 |
342 |
323 #process binary path |
343 #process bin path |
324 if [ -z "$QT_MOBILITY_BIN" ]; then |
344 if [ -z "$QT_MOBILITY_BIN" ]; then |
325 QT_MOBILITY_BIN="$QT_MOBILITY_PREFIX/$BIN_PATH" |
345 QT_MOBILITY_BIN="$QT_MOBILITY_PREFIX/$BIN_PATH" |
326 elif [ -d "$QT_MOBILITY_BIN" ]; then |
346 else |
327 QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET` |
347 QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET` |
328 else |
348 if [ "$?" -eq "1" ]; then |
329 mkdir -p "$QT_MOBILITY_BIN" |
349 exit 1 |
330 QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET` |
350 fi |
331 rm -rf "$QT_MOBILITY_BIN" |
|
332 fi |
351 fi |
333 echo "QT_MOBILITY_BIN = $QT_MOBILITY_BIN" >> "$CONFIG_IN" |
352 echo "QT_MOBILITY_BIN = $QT_MOBILITY_BIN" >> "$CONFIG_IN" |
|
353 |
|
354 #process plugin path |
|
355 if [ -z "$QT_MOBILITY_PLUGINS" ]; then |
|
356 QT_MOBILITY_PLUGINS="$QT_MOBILITY_PREFIX/$PLUGIN_PATH" |
|
357 else |
|
358 QT_MOBILITY_PLUGINS=`absPath $QT_MOBILITY_PLUGINS $LINUX_TARGET` |
|
359 if [ "$?" -eq "1" ]; then |
|
360 exit 1 |
|
361 fi |
|
362 fi |
|
363 echo "QT_MOBILITY_PLUGINS = $QT_MOBILITY_PLUGINS" >> "$CONFIG_IN" |
|
364 |
334 |
365 |
335 echo "QT_MOBILITY_SOURCE_TREE = $relpath" >> "$QMAKE_CACHE" |
366 echo "QT_MOBILITY_SOURCE_TREE = $relpath" >> "$QMAKE_CACHE" |
336 echo "QT_MOBILITY_BUILD_TREE = $shadowpath" >> "$QMAKE_CACHE" |
367 echo "QT_MOBILITY_BUILD_TREE = $shadowpath" >> "$QMAKE_CACHE" |
337 |
368 |
338 if [ -n "$MAC_SDK" ]; then |
369 if [ -n "$MAC_SDK" ]; then |
428 compileTest QMF qmf |
459 compileTest QMF qmf |
429 compileTest NetworkManager networkmanager |
460 compileTest NetworkManager networkmanager |
430 compileTest "CoreWLAN (MacOS 10.6)" corewlan |
461 compileTest "CoreWLAN (MacOS 10.6)" corewlan |
431 compileTest "Maemo ICD" maemo-icd |
462 compileTest "Maemo ICD" maemo-icd |
432 compileTest "Maemo ICD WLAN" maemo-icd-network-wlan |
463 compileTest "Maemo ICD WLAN" maemo-icd-network-wlan |
|
464 compileTest "Maemo5 contacts dependencies" maemo5-contacts |
|
465 if [ "$LINUX_TARGET" = maemo6 ]; then |
|
466 compileTest sensord sensord |
|
467 else |
|
468 echo "sensord_enabled = no" >> "$CONFIG_IN" |
|
469 fi |
433 |
470 |
434 # Now module selection |
471 # Now module selection |
435 # using 'expr match ....' should help a bit |
472 # using 'expr match ....' should help a bit |
436 #if [ -n "$MOBILITY_MODULES_UNPARSED" ]; then |
473 #if [ -n "$MOBILITY_MODULES_UNPARSED" ]; then |
437 # In theory we should do some sanity checking here. |
474 # In theory we should do some sanity checking here. |
438 # MOBILITY_MODULES="$MOBILITY_MODULES_UNPARSED" |
475 # MOBILITY_MODULES="$MOBILITY_MODULES_UNPARSED" |
439 #fi |
476 #fi |
|
477 |
|
478 # Test if able to build multimedia |
|
479 for module in $MOBILITY_MODULES; do |
|
480 case "$module" in |
|
481 multimedia) |
|
482 echo "contains(QT_CONFIG,multimedia):message(1)" > 1.pro |
|
483 SOMETHING=`qmake 1.pro 2>&1` |
|
484 if [ "$SOMETHING" = "Project MESSAGE: 1" ]; then |
|
485 MOBILITY_MODULES="$(echo $MOBILITY_MODULES | sed 's:multimedia::g')" |
|
486 echo "Only one multimedia module allowed, please rebuild Qt with -no-multimedia" |
|
487 fi |
|
488 rm 1.pro |
|
489 ;; |
|
490 esac |
|
491 done |
|
492 |
|
493 if [ -z "$MOBILITY_MODULES" ]; then |
|
494 echo "No module available to build." |
|
495 exit 1 |
|
496 fi |
440 |
497 |
441 # It's a lot easier to make qmake do the dependency checking... |
498 # It's a lot easier to make qmake do the dependency checking... |
442 echo "mobility_modules = $MOBILITY_MODULES" >> "$CONFIG_IN" |
499 echo "mobility_modules = $MOBILITY_MODULES" >> "$CONFIG_IN" |
443 echo "contains(mobility_modules,versit): mobility_modules *= contacts" >> "$CONFIG_IN" |
500 echo "contains(mobility_modules,versit): mobility_modules *= contacts" >> "$CONFIG_IN" |
444 echo "maemo5|maemo6:contains(maemo-icd_enabled, no): mobility_modules -= bearer" >> "$CONFIG_IN" |
501 echo "maemo5|maemo6:contains(maemo-icd_enabled, no): mobility_modules -= bearer" >> "$CONFIG_IN" |
453 rm -rf $shadowpath/include |
510 rm -rf $shadowpath/include |
454 mkdir $shadowpath/include |
511 mkdir $shadowpath/include |
455 for module in $MOBILITY_MODULES; do |
512 for module in $MOBILITY_MODULES; do |
456 case "$module" in |
513 case "$module" in |
457 bearer) |
514 bearer) |
458 $relpath/bin/syncheaders $shadowpath/include $relpath/src/bearer |
515 $relpath/bin/syncheaders $shadowpath/include/QtmBearer $relpath/src/bearer |
459 ;; |
516 ;; |
460 publishsubscribe) |
517 publishsubscribe) |
461 $relpath/bin/syncheaders $shadowpath/include $relpath/src/publishsubscribe |
518 $relpath/bin/syncheaders $shadowpath/include/QtmPubSub $relpath/src/publishsubscribe |
462 ;; |
519 ;; |
463 location) |
520 location) |
464 $relpath/bin/syncheaders $shadowpath/include $relpath/src/location |
521 $relpath/bin/syncheaders $shadowpath/include/QtmLocation $relpath/src/location |
465 ;; |
522 ;; |
466 serviceframework) |
523 serviceframework) |
467 $relpath/bin/syncheaders $shadowpath/include $relpath/src/serviceframework |
524 $relpath/bin/syncheaders $shadowpath/include/QtmServiceFramework $relpath/src/serviceframework |
468 ;; |
525 ;; |
469 systeminfo) |
526 systeminfo) |
470 $relpath/bin/syncheaders $shadowpath/include $relpath/src/systeminfo |
527 $relpath/bin/syncheaders $shadowpath/include/QtmSystemInfo $relpath/src/systeminfo |
471 ;; |
528 ;; |
472 contacts) |
529 contacts) |
473 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts |
530 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts |
474 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/details |
531 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/details |
475 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/requests |
532 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/requests |
476 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/filters |
533 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/filters |
477 ;; |
534 ;; |
478 multimedia) |
535 multimedia) |
479 $relpath/bin/syncheaders $shadowpath/include $relpath/src/multimedia |
536 $relpath/bin/syncheaders $shadowpath/include/QtMultimedia $relpath/src/multimedia |
|
537 $relpath/bin/syncheaders $shadowpath/include/QtMultimedia $relpath/src/multimedia/audio |
|
538 $relpath/bin/syncheaders $shadowpath/include/QtMultimedia $relpath/src/multimedia/video |
480 ;; |
539 ;; |
481 messaging) |
540 messaging) |
482 $relpath/bin/syncheaders $shadowpath/include $relpath/src/messaging |
541 $relpath/bin/syncheaders $shadowpath/include/QtmMessaging $relpath/src/messaging |
483 ;; |
542 ;; |
484 versit) |
543 versit) |
485 #versit implies contacts |
544 #versit implies contacts |
486 $relpath/bin/syncheaders $shadowpath/include $relpath/src/versit |
545 $relpath/bin/syncheaders $shadowpath/include/QtmVersit $relpath/src/versit |
487 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts |
546 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts |
488 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/details |
547 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/details |
489 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/requests |
548 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/requests |
490 $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/filters |
549 $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/filters |
491 ;; |
550 ;; |
492 sensors) |
551 sensors) |
493 $relpath/bin/syncheaders $shadowpath/include $relpath/src/sensors |
552 $relpath/bin/syncheaders $shadowpath/include/QtmSensors $relpath/src/sensors |
494 ;; |
553 ;; |
495 *) |
554 *) |
496 echo "Cannot generate headers for $module" |
555 echo "Cannot generate headers for $module" |
497 ;; |
556 ;; |
498 esac |
557 esac |