Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# Instructions for Building Qtopia Desktop

- Introduction
- Windows
- Linux
- Mac OS X
- Latin-Based Character Patch
  - Windows
  - Linux
  - Mac OS X

## Introduction

This document sets out instructions for the building of Qtopia Desktop.

Qtopia Desktop requires Qt 3.3.0 or later. If you want to use UTF-8 (non-latin1) filenames when sending Documents to Qtopia you will need apply a patch to Qt. Please see the section about the latin-based character patch for details on how to modify your code.

NOTE: If you build Qtopia Desktop with Qt 3.3.3 you will not be able to perform any synchronization. The exact cause of this problem is not known at this time so it is recommended that you do not use Qt 3.3.3.

## Windows

1. Qt 3.3.0 and commercial source code for Qtopia are required to build Qtopia Desktop. Download and install Qt 3.3.0 for windows with default settings, (ie install to c:\qt\3.3.0, substitute below if different)
2. If QMAKESPEC has not been set, set QMAKESPEC appropriately for the compiler that is to be used.
   For MS Visual C++:

                       set QMAKESPEC=win32-msvc

   Otherwise if the newer .NET compiler is to be used:

                       set QMAKESPEC=win32-msvc.net

3. Compile Qt:

                       set QTDIR=c:\qt\3.3.0
                       set PATH=%QTDIR%\bin;%PATH%
                       cd %QTDIR%
                       configure -thread -no-stl
                       nmake

   Build assistant.exe and qaxcontainer.dll:

                       cd %QTDIR%\tools\assistant
                       nmake
                       cd %QTDIR%\extensions\activeqt
                       nmake

   Qt is now ready to be used with Qtopia Desktop

4. Install Qtopia source to c:\qtopia\2.1.1 (substitute below if different)

   If QMAKESPEC has not been set, set QMAKESPEC appropriately for the compiler that is to be used.
   For MS Visual C++:

                       set QMAKESPEC=win32-msvc

   Otherwise if the newer .NET compiler is to be used:

                       set QMAKESPEC=win32-msvc.net

   Qtopia also provides a spec for the Standard edition of the .NET compiler (reduces the number of warnings due to missing compiler features)

                       set QMAKESPEC=win32-msvc.net_std

5. Compile Qtopia Desktop and all of its plugins:

                       set DQTDIR=c:\qt\3.3.0
                       set QPEDIR=c:\qtopia\2.1.1
                       set PATH=%QPEDIR%\bin;%DQTDIR%\bin;%PATH%
                       cd %QPEDIR%
                       scripts\mkwindows-qtopiadesktop.bat

   Qtopia Desktop is now "installed" in %QPEDIR%\dimage\opt\Qtopia
   Please read %QPEDIR%\src\qtopiadesktop\dist\README if you wish to make an installer.

## Linux

1. Qt 3.3.0 and commercial source code for Qtopia are required to build Qtopia Desktop. Download and extract Qt 3.3.0 for X11.
2. Compile qt:

                       tar xfz qt-x11-commercial-3.3.0.tar.gz
                       cd qt-x11-commercial-3.3.0
                       export QTDIR=$PWD
                       export PATH=$QTDIR/bin:$PATH
                       ./configure -thread
                       make
                       cd ..

3. Extract Qtopia source package for example to ~/qtopia-source-2.1.1 (substitute below if different)
4. Compile Qtopia Desktop as follows:

                       tar xfz qtopia-source-2.1.1.tar.gz
                       cd qtopia-source-2.1.1
                       export QPEDIR=$PWD
                       export DQTDIR=$QTDIR
                       export PATH=$QPEDIR/bin:$DQTDIR/bin:$PATH
                       export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH
                       ./configure -no-qtopia
                       make
                       rm -rf dimage
                       make install

   Qtopia Desktop is now "installed" in $QPEDIR/dimage/opt/Qtopia

## Mac OS X

1. Qt 3.3.0 and commercial source code for Qtopia are required to build Qtopia Desktop. Download and extract Qt 3.3.0 for Mac OS X.
2. Compile qt:

                       tar xfz qt-mac-commercial-3.3.0.tar.gz
                       cd qt-mac-commercial-3.3.0
                       export QTDIR=$PWD
                       export PATH=$QTDIR/bin:$PATH
                       export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
                       export DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH
                       ./configure -thread
                       make
                       cd ..

   If you are building Qtopia Desktop as a user that is not logged into the (GUI) console you will need to allow uic to talk to the Window Server.

                       cd qt-mac-commercial-3.3.0/bin
                       sudo chown root uic
                       sudo chown 4755 uic
                       sudo install_name_tool -change libqt-mt.3.dylib /path/to/qt-mac-commercial-3.3.0/lib/libqt-mt.3.dylib uic

   Note that you will need to be an administrator to do this. Sudo will prompt you for your password.

3. Extract Qtopia source package for example to ~/qtopia-source-2.1.1 (substitute below if different)
4. Compile Qtopia Desktop as follows:

                       tar xfz qtopia-source-2.1.1.tar.gz
                       cd qtopia-source-2.1.1
                       export QPEDIR=$PWD
                       export DQTDIR=$QTDIR
                       export PATH=$QPEDIR/bin:$DQTDIR/bin:$PATH
                       export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH
                       export DYLD_LIBRARY_PATH=$QPEDIR/lib:$DYLD_LIBRARY_PATH
                       scripts/mkmacosx-qtopiadesktop

   Qtopia Desktop is now "installed" in $QPEDIR/Qtopia Desktop.app

## Latin-Based Character Patch

This section only applies to customers who are building their own Qtopia Desktop release.

All versions of Qtopia Desktop built with Qt 3.3.2 or earlier cannot transfer non-latin1 files to a Qtopia device. This is of particular relevance to developers using non-latin-based alphabets. Qtopia Desktop will continue to work with Qt 3.3.2 or earlier but will not use UTF-8 for filenames.

Qtopia Desktop automatically uses UTF-8 for filenames with Qt 3.3.3 and above (Qt 3.3.4 for Windows).

Windows users with Qt 3.3.3 need to apply win32-qt333-ftp-codec.patch.

Users with Qt 3.3.2 or earlier need to apply qt330-ftp-codec.patch. This patch was made for Qt 3.3.0 so it may need to be manually applied to 3.3.1 and 3.3.2.

When you run Qtopia Desktop it will output a line of debug saying either: "Qtopia Desktop can use UTF-8 filenames" or "Qtopia Desktop can only use ASCII filenames".

Windows users will need to install debugview (http://www.sysinternals.com/ntw2k/freeware/debugview.shtml) to see the debug output.

Mac OS X users will need to open `/Applications/Utilities/Console.app` or view `/Library/Logs/Console/<username>/console.log` to see the debug output.

### Windows

You will also need the patch utility. This can be downloaded from http://unxutils.sourceforge.net/. Place `patch.exe` somewhere that is in your path (eg. C:\Windows).

- To install the Qt 3.3.2 and earlier patch:

                      cd %QTDIR%
                      patch.exe -p1 <%QPEDIR%\scripts\qt330-ftp-codec.patch

- To install the Qt 3.3.3 patch:

                      cd %QTDIR%
                      patch.exe -p1 <%QPEDIR%\scripts\win32-qt333-ftp-codec.patch

Qt must be rebuilt after applying the patch. The easiest way is probably to setup the Qtopia Desktop build environment and run:

                    cd %QTDIR%
                    nmake
                    cd %QPEDIR%
                    config.status
                    nmake
                    nmake install

This will rebuild Qt and Qtopia Desktop.

### Linux

Ensure patch is installed on your system. You might need to use your setup program to install patch.

- To install the Qt 3.3.2 and earlier patch:

                      cd $QTDIR
                      patch -p1 <$QPEDIR/scripts/qt330-ftp-codec.patch

### Mac OS X

- To install the Qt 3.3.2 and earlier patch:

                      cd $QTDIR
                      patch -p1 <$QPEDIR/scripts/qt330-ftp-codec.patch