qtmobility/configure
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
child 15 1f895d8a5b2b
--- a/qtmobility/configure	Fri Jun 11 14:26:25 2010 +0300
+++ b/qtmobility/configure	Wed Jun 23 19:08:38 2010 +0300
@@ -58,17 +58,16 @@
 # 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 "Relative prefix paths are not supported for Maemo"
+            echo >&2 "Relative prefix/bin/lib/header/plugin paths are not supported for Maemo"
             exit 1;
         fi
     else
-        RESULT=`(cd "$1"; /bin/pwd)`
-        echo $RESULT
+        PATH=`$relpath/bin/pathhelper $1`
+        echo $PATH
     fi
 }
 
@@ -312,24 +311,20 @@
 fi
 
 #process PREFIX
-if [ -d "$QT_MOBILITY_PREFIX" ]; then
-    QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET`
-else
-    mkdir -p "$QT_MOBILITY_PREFIX"
-    QT_MOBILITY_PREFIX=`absPath $QT_MOBILITY_PREFIX $LINUX_TARGET`
-    rm -rf "$QT_MOBILITY_PREFIX"
+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
+else
     QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET`
-else
-    mkdir -p "$QT_MOBILITY_INCLUDE"
-    QT_MOBILITY_INCLUDE=`absPath $QT_MOBILITY_INCLUDE $LINUX_TARGET`
-    rm -rf "$QT_MOBILITY_INCLUDE"
+    if [ "$?" -eq "1" ]; then
+        exit 1
+    fi
 fi
 echo "QT_MOBILITY_INCLUDE = $QT_MOBILITY_INCLUDE" >> "$CONFIG_IN"
 
@@ -337,36 +332,33 @@
 #process library path
 if [ -z "$QT_MOBILITY_LIB" ]; then
     QT_MOBILITY_LIB="$QT_MOBILITY_PREFIX/$LIB_PATH"
-elif [ -d "$QT_MOBILITY_LIB" ]; then
+else
     QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET`
-else
-    mkdir -p "$QT_MOBILITY_LIB"
-    QT_MOBILITY_LIB=`absPath $QT_MOBILITY_LIB $LINUX_TARGET`
-    rm -rf "$QT_MOBILITY_LIB"
+    if [ "$?" -eq "1" ]; then
+        exit 1
+    fi
 fi
 echo "QT_MOBILITY_LIB = $QT_MOBILITY_LIB" >> "$CONFIG_IN"
 
 #process bin path
 if [ -z "$QT_MOBILITY_BIN" ]; then
     QT_MOBILITY_BIN="$QT_MOBILITY_PREFIX/$BIN_PATH"
-elif [ -d "$QT_MOBILITY_BIN" ]; then
+else
     QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET`
-else
-    mkdir -p "$QT_MOBILITY_BIN"
-    QT_MOBILITY_BIN=`absPath $QT_MOBILITY_BIN $LINUX_TARGET`
-    rm -rf "$QT_MOBILITY_BIN"
+    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"
-elif [ -d "$QT_MOBILITY_PLUGINS" ]; then
+else
     QT_MOBILITY_PLUGINS=`absPath $QT_MOBILITY_PLUGINS $LINUX_TARGET`
-else
-    mkdir -p "$QT_MOBILITY_PLUGINS"
-    QT_MOBILITY_PLUGINS=`absPath $QT_MOBILITY_PLUGINS $LINUX_TARGET`
-    rm -rf "$QT_MOBILITY_PLUGINS"
+    if [ "$?" -eq "1" ]; then
+        exit 1
+    fi
 fi
 echo "QT_MOBILITY_PLUGINS = $QT_MOBILITY_PLUGINS" >> "$CONFIG_IN"
 
@@ -469,6 +461,7 @@
 compileTest "CoreWLAN (MacOS 10.6)" corewlan
 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
@@ -482,6 +475,26 @@
 #    MOBILITY_MODULES="$MOBILITY_MODULES_UNPARSED"
 #fi
 
+# Test if able to build multimedia
+for module in $MOBILITY_MODULES; do
+    case "$module" in
+        multimedia)
+            echo "contains(QT_CONFIG,multimedia):message(1)" > 1.pro
+            SOMETHING=`qmake 1.pro 2>&1`
+            if [ "$SOMETHING" = "Project MESSAGE: 1" ]; then
+                MOBILITY_MODULES="$(echo $MOBILITY_MODULES | sed 's:multimedia::g')"
+                echo "Only one multimedia module allowed, please rebuild Qt with -no-multimedia"
+            fi
+            rm 1.pro
+            ;;
+    esac
+done
+
+if [ -z "$MOBILITY_MODULES" ]; then
+    echo "No module available to build."
+    exit 1
+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"
@@ -520,7 +533,9 @@
             $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/filters
             ;;
         multimedia)
-            $relpath/bin/syncheaders $shadowpath/include/QtmMedia $relpath/src/multimedia
+            $relpath/bin/syncheaders $shadowpath/include/QtMultimedia $relpath/src/multimedia
+            $relpath/bin/syncheaders $shadowpath/include/QtMultimedia $relpath/src/multimedia/audio
+            $relpath/bin/syncheaders $shadowpath/include/QtMultimedia $relpath/src/multimedia/video
             ;;
         messaging)
             $relpath/bin/syncheaders $shadowpath/include/QtmMessaging $relpath/src/messaging