diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2010-06-23 15:55:32 +1000 |
---|---|---|
committer | Michael Goddard <michael.goddard@nokia.com> | 2010-06-23 15:55:32 +1000 |
commit | 677ecf084128460da02c48bcb67be7461cc7252f (patch) | |
tree | ebdcce0449ff947f3588f9524e573f6135fccd39 /configure | |
parent | 92f683ae2e809fc6d71fe7853f1d578ff704706c (diff) | |
parent | b0b9ba504686126dd77d4f9d585e5c5b4f9eded4 (diff) |
Merge branch 'master' of scm.dev.nokia.troll.no:qtmobility/qtmobility
Conflicts:
configure
configure.bat
features/mobility.prf.template
plugins/plugins.pro
src/global/qmobilityglobal.h
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 238 |
1 files changed, 180 insertions, 58 deletions
@@ -1,7 +1,7 @@ #!/bin/sh ############################################################################# ## -## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## @@ -40,6 +40,38 @@ ## ############################################################################# +# return status of 1 if absolute path as first argument +# also prints the return status +isAbsPath() { + slash=$(echo $1 | cut -c 1) + if [ "$slash" != "/" ]; then + echo 0 + return 0 + fi + echo 1 + return 1 +} + +# Returns the absolute path for $1 for target $2 +# as an example $2 might have value "maemo5". +# This is required because when building in scratchbox for +# maemo we do not want to follow symbolic links that are +# introduced by scratchbox +absPath() { + if [ "$2" = "maemo5" -o "$2" = "maemo6" ]; then + if [ `isAbsPath $1` = '1' ]; then + echo $1; + else + echo >&2 "Relative prefix/bin/lib/header/plugin paths are not supported for Maemo" + exit 1; + fi + else + PATH=`$relpath/bin/pathhelper $1` + echo $PATH + fi +} + + # the current directory (shadow build dir) shadowpath=`/bin/pwd` # the name of this script @@ -53,24 +85,31 @@ QT_MOBILITY_PREFIX=$shadowpath/install QT_MOBILITY_INCLUDE= QT_MOBILITY_LIB= QT_MOBILITY_BIN= +QT_MOBILITY_PLUGINS= BUILD_UNITTESTS= BUILD_EXAMPLES= +BUILD_DEMOS= BUILD_DOCS=yes +BUILD_TOOLS=yes RELEASEMODE= BUILD_SILENT= LINUX_TARGET= QMAKE_CACHE="$shadowpath/.qmake.cache" LIB_PATH="lib" BIN_PATH="bin" +PLUGIN_PATH="plugins" MAC_SDK= -MOBILITY_MODULES="bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework feedback" +MOBILITY_MODULES="bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors feedback" MOBILITY_MODULES_UNPARSED= +QMKSPEC= +OS="other" usage() { echo "Usage: configure [-prefix <dir>] [headerdir <dir>] [libdir <dir>]" echo " [-bindir <dir>] [-tests] [-examples] [-no-docs]" - echo " [-debug] [-release] [-silent] [-modules <list>]" + echo " [-no-tools] [-debug] [-release] [-silent]" + echo " [-modules <list>]" echo echo "Options:" echo @@ -82,6 +121,8 @@ usage() echo " (default PREFIX/lib)" echo "-bindir <dir> ..... Executables will be installed to <dir>" echo " (default PREFIX/bin)" + echo "-plugindir <dir> .. Plug-ins will be installed to <dir>" + echo " (default PREFIX/plugins)" echo "-debug ............ Build with debugging symbols" echo "-release .......... Build without debugging symbols" echo "-silent ........... Reduces build output" @@ -89,15 +130,18 @@ usage() echo " Note, this adds test symbols to all libraries" echo " and should not be used for release builds." echo "-examples ......... Build example applications" + echo "-demos ............ Build demo applications" echo "-no-docs .......... Do not build documentation (build by default)" + echo "-no-tools ......... Do not build tools (build by default)" echo "-modules <list> ... Restrict list of modules to build (default all supported)" echo " Choose from: bearer contacts location publishsubscribe" - echo " messaging multimedia systeminfo serviceframework versit feedback" - echo " Modules should be separated by a space. If a" - echo " selected module depends on other modules they" - echo " will automatically be enabled." + echo " messaging multimedia systeminfo serviceframework versit" + echo " sensors feedback" + echo " Modules should be separated by a space and surrounded" + echo " by double quotation. If a selected module depends on other modules" + echo " those modules (and their dependencies) will automatically be enabled." echo "-maemo6 ........... Build Qt Mobility for Maemo6 (Harmattan)." - echo "-maemo5 ........... Build Qt Mobility for Maemo5 (Freemantle)." + echo "-maemo5 ........... Build Qt Mobility for Maemo5 (Fremantle)." echo "-sdk <sdk>..........Build using Apple provided SDK <path/to/sdk>." echo " example: -sdk /Developer/SDKs/MacOSX10.6.sdk" echo @@ -131,15 +175,25 @@ while [ "$#" -gt 0 ]; do QT_MOBILITY_BIN="$2" shift ;; + -plugindir) + QT_MOBILITY_PLUGINS="$2" + shift + ;; -tests) BUILD_UNITTESTS="yes" ;; + -demos) + BUILD_DEMOS="yes" + ;; -examples) BUILD_EXAMPLES="yes" ;; -no-docs) BUILD_DOCS= ;; + -no-tools) + BUILD_TOOLS= + ;; -debug) RELEASEMODE=debug ;; @@ -165,7 +219,7 @@ while [ "$#" -gt 0 ]; do MOBILITY_MODULES= for m in $MOBILITY_MODULES_UNPARSED; do case "$m" in - bearer|contacts|location|messaging|multimedia|publishsubscribe|serviceframework|systeminfo|versit|feedback) + bearer|contacts|location|messaging|multimedia|publishsubscribe|serviceframework|systeminfo|versit|sensors|feedback) MOBILITY_MODULES="$MOBILITY_MODULES $m"; ;; *) @@ -191,13 +245,23 @@ while [ "$#" -gt 0 ]; do shift done +checkostype() +{ + match="darwin" + if [ "$OSTYPE" = "${match}"* ]; then + OS="darwin" + QMKSPEC="-spec macx-g++" + echo "QMAKESPEC = "$QMKSPEC >> "$CONFIG_IN" + fi +} + findframeworks() { # figure out if Qt was built with frameworks # if so, install in the correct place. # and fix rpath echo "contains(QT_CONFIG,qt_framework):message(1)" > 1.pro - SOMETHING=`qmake 1.pro 2>&1` + SOMETHING=`qmake -spec macx-g++ 1.pro 2>&1` if [ "$SOMETHING" = "Project MESSAGE: 1" ]; then LIB_PATH="Library/Frameworks" BIN_PATH="Applications" @@ -205,12 +269,37 @@ findframeworks() rm 1.pro } -findframeworks + +findUniversal() +{ + if [ -e "mac.inc" ]; then + rm mac.inc + fi + echo "contains(QT_CONFIG,x86): system(echo CONFIG+=x86 >> mac.inc)" > 2.pro + echo "contains(QT_CONFIG,ppc): system(echo CONFIG+=ppc >> mac.inc)" >> 2.pro + echo "contains(QT_CONFIG,ppc64): system(echo CONFIG+=ppc64 >> mac.inc)" >> 2.pro + echo "contains(QT_CONFIG,x86_64): system(echo CONFIG+=x86_64 >> mac.inc)" >> 2.pro + SOMETIME=`qmake -spec macx-g++ 2.pro 2>&1` + rm 2.pro + if [ -e "mac.inc" ]; then + echo "exists(mac.inc): include(mac.inc)" >> "$CONFIG_IN" + fi +} + +checkostype + +if [ "$OS" = "darwin" ] ; then + findframeworks +fi if [ -n "$BUILD_SILENT" ]; then echo "CONFIG += silent" > "$CONFIG_IN" fi +if [ "$OS" = "darwin" ] ; then + findUniversal +fi + if [ -z "$RELEASEMODE" ]; then RELEASEMODE="debug" fi @@ -226,26 +315,20 @@ if [ -n "$LINUX_TARGET" ]; then fi #process PREFIX -if [ -d "$QT_MOBILITY_PREFIX" ]; then - QT_MOBILITY_PREFIX=`(cd "$QT_MOBILITY_PREFIX"; /bin/pwd)` -else - mkdir -p "$QT_MOBILITY_PREFIX" - absPath=`(cd "$QT_MOBILITY_PREFIX"; /bin/pwd)` - rm -rf "$QT_MOBILITY_PREFIX" - QT_MOBILITY_PREFIX="$absPath" +QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET` +if [ "$?" -eq "1" ]; then + exit 1 fi echo "QT_MOBILITY_PREFIX = $QT_MOBILITY_PREFIX" >> "$CONFIG_IN" #process include path if [ -z "$QT_MOBILITY_INCLUDE" ]; then QT_MOBILITY_INCLUDE="$QT_MOBILITY_PREFIX/include" -elif [ -d "$QT_MOBILITY_INCLUDE" ]; then - QT_MOBILITY_INCLUDE=`(cd "$QT_MOBILITY_INCLUDE"; /bin/pwd)` else - mkdir -p "$QT_MOBILITY_INCLUDE" - absPath=`(cd "$QT_MOBILITY_INCLUDE"; /bin/pwd)` - rm -rf "$QT_MOBILITY_INCLUDE" - QT_MOBILITY_INCLUDE="$absPath" + QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET` + if [ "$?" -eq "1" ]; then + exit 1 + fi fi echo "QT_MOBILITY_INCLUDE = $QT_MOBILITY_INCLUDE" >> "$CONFIG_IN" @@ -253,29 +336,37 @@ echo "QT_MOBILITY_INCLUDE = $QT_MOBILITY_INCLUDE" >> "$CONFIG_IN" #process library path if [ -z "$QT_MOBILITY_LIB" ]; then QT_MOBILITY_LIB="$QT_MOBILITY_PREFIX/$LIB_PATH" -elif [ -d "$QT_MOBILITY_LIB" ]; then - QT_MOBILITY_LIB=`(cd "$QT_MOBILITY_LIB"; /bin/pwd)` else - mkdir -p "$QT_MOBILITY_LIB" - absPath=`(cd "$QT_MOBILITY_LIB"; /bin/pwd)` - rm -rf "$QT_MOBILITY_LIB" - QT_MOBILITY_LIB="$absPath" + QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET` + if [ "$?" -eq "1" ]; then + exit 1 + fi fi echo "QT_MOBILITY_LIB = $QT_MOBILITY_LIB" >> "$CONFIG_IN" -#process binary path +#process bin path if [ -z "$QT_MOBILITY_BIN" ]; then QT_MOBILITY_BIN="$QT_MOBILITY_PREFIX/$BIN_PATH" -elif [ -d "$QT_MOBILITY_BIN" ]; then - QT_MOBILITY_BIN=`(cd "$QT_MOBILITY_BIN"; /bin/pwd)` else - mkdir -p "$QT_MOBILITY_BIN" - absPath=`(cd "$QT_MOBILITY_BIN"; /bin/pwd)` - rm -rf "$QT_MOBILITY_BIN" - QT_MOBILITY_BIN="$absPath" + QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET` + if [ "$?" -eq "1" ]; then + exit 1 + fi fi echo "QT_MOBILITY_BIN = $QT_MOBILITY_BIN" >> "$CONFIG_IN" +#process plugin path +if [ -z "$QT_MOBILITY_PLUGINS" ]; then + QT_MOBILITY_PLUGINS="$QT_MOBILITY_PREFIX/$PLUGIN_PATH" +else + QT_MOBILITY_PLUGINS=`absPath $QT_MOBILITY_PLUGINS $LINUX_TARGET` + if [ "$?" -eq "1" ]; then + exit 1 + fi +fi +echo "QT_MOBILITY_PLUGINS = $QT_MOBILITY_PLUGINS" >> "$CONFIG_IN" + + echo "QT_MOBILITY_SOURCE_TREE = $relpath" >> "$QMAKE_CACHE" echo "QT_MOBILITY_BUILD_TREE = $shadowpath" >> "$QMAKE_CACHE" @@ -296,12 +387,24 @@ else echo "build_examples = yes" >> "$CONFIG_IN" fi +if [ -z "$BUILD_DEMOS" ]; then + echo "build_demos = no" >> "$CONFIG_IN" +else + echo "build_demos = yes" >> "$CONFIG_IN" +fi + if [ -z "$BUILD_DOCS" ]; then echo "build_docs = no" >> "$CONFIG_IN" else echo "build_docs = yes" >> "$CONFIG_IN" fi +if [ -z "$BUILD_TOOLS" ]; then + echo "build_tools = no" >> "$CONFIG_IN" +else + echo "build_tools = yes" >> "$CONFIG_IN" +fi + echo "Configuring Qt Mobility" echo @@ -346,7 +449,7 @@ compileTest() cd config.tests/$2 fi - qmake "$relpath/config.tests/$2/$2.pro" >> "$CONFIG_LOG" + qmake $QMKSPEC "$relpath/config.tests/$2/$2.pro" 2>> "$CONFIG_LOG" >> "$CONFIG_LOG" printf " ." "$MAKE" clean >> "$CONFIG_LOG" printf "." @@ -367,55 +470,70 @@ compileTest QMF qmf compileTest NetworkManager networkmanager compileTest "CoreWLAN (MacOS 10.6)" corewlan compileTest Immersion immersion - -# Now module selection -# using 'expr match ....' should help a bit -#if [ -n "$MOBILITY_MODULES_UNPARSED" ]; then - # In theory we should do some sanity checking here. -# MOBILITY_MODULES="$MOBILITY_MODULES_UNPARSED" -#fi +compileTest "Maemo ICD" maemo-icd +compileTest "Maemo ICD WLAN" maemo-icd-network-wlan +compileTest "Maemo5 contacts dependencies" maemo5-contacts +if [ "$LINUX_TARGET" = maemo6 ]; then + compileTest sensord sensord +else + echo "sensord_enabled = no" >> "$CONFIG_IN" +fi # It's a lot easier to make qmake do the dependency checking... echo "mobility_modules = $MOBILITY_MODULES" >> "$CONFIG_IN" echo "contains(mobility_modules,versit): mobility_modules *= contacts" >> "$CONFIG_IN" +echo "maemo5|maemo6:contains(maemo-icd_enabled, no): mobility_modules -= bearer" >> "$CONFIG_IN" + +# If libicd-network-wlan-dev.h is not present, use own copy. +# At time of writing, libicd-network-wlan-dev is not released for maemo5. +echo "maemo5:contains(maemo-icd-network-wlan_enabled, no): INCLUDEPATH += $relpath/src/3rdparty/icd-network-wlan" >> "$CONFIG_IN" # Ideally we'd skip generating headers for modules that are not enabled echo "Generating Mobility Headers..." #remove old headers rm -rf $shadowpath/include mkdir $shadowpath/include -$relpath/bin/syncheaders $shadowpath/include $relpath/src/global for module in $MOBILITY_MODULES; do case "$module" in bearer) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/bearer + $relpath/bin/syncheaders $shadowpath/include/QtBearer $relpath/src/bearer ;; publishsubscribe) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/publishsubscribe + $relpath/bin/syncheaders $shadowpath/include/QtPublishSubscribe $relpath/src/publishsubscribe ;; location) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/location + $relpath/bin/syncheaders $shadowpath/include/QtLocation $relpath/src/location ;; serviceframework) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/serviceframework + $relpath/bin/syncheaders $shadowpath/include/QtServiceFramework $relpath/src/serviceframework ;; systeminfo) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/systeminfo + $relpath/bin/syncheaders $shadowpath/include/QtSystemInfo $relpath/src/systeminfo ;; contacts) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts/details + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts/requests + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts/filters ;; multimedia) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/multimedia - $relpath/bin/syncheaders $shadowpath/include $relpath/src/multimedia/experimental + $relpath/bin/syncheaders $shadowpath/include/QtMultimediaKit $relpath/src/multimedia + $relpath/bin/syncheaders $shadowpath/include/QtMultimediaKit $relpath/src/multimedia/audio + $relpath/bin/syncheaders $shadowpath/include/QtMultimediaKit $relpath/src/multimedia/video ;; messaging) - $relpath/bin/syncheaders $shadowpath/include $relpath/src/messaging + $relpath/bin/syncheaders $shadowpath/include/QtMessaging $relpath/src/messaging ;; versit) #versit implies contacts - $relpath/bin/syncheaders $shadowpath/include $relpath/src/versit - $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts + $relpath/bin/syncheaders $shadowpath/include/QtVersit $relpath/src/versit + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts/details + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts/requests + $relpath/bin/syncheaders $shadowpath/include/QtContacts $relpath/src/contacts/filters + ;; + sensors) + $relpath/bin/syncheaders $shadowpath/include/QtSensors $relpath/src/sensors ;; feedback) $relpath/bin/syncheaders $shadowpath/include $relpath/src/feedback @@ -428,12 +546,16 @@ done mv "$CONFIG_IN" config.pri mkdir -p "$shadowpath/features" +if [ "$shadowpath" != "$relpath" ]; then + cp -f "$relpath/features/strict_flags.prf" "$shadowpath/features" +fi echo "Running qmake..." -if qmake -recursive "$relpath/qtmobility.pro"; then +if qmake -makefile $QMKSPEC -recursive "$relpath/qtmobility.pro"; then echo "" echo "configure has finished. You may run make or gmake to build the project now." else echo "" echo "configure failed." fi + |