Qtopia Home · Home · Reference · User Guide · Internals

Creating and using binary SDKs

Creating a binary SDK

When Qtopia is built it can be made to produce a binary SDK. This is a directory that can be used to build third party applications.

To enable this you must pass -sdk /path/to/sdk to configure. The SDK is automatically created when you run make install or you can manually create it by running make sdk after you have built it.

A common reason to use binary SDKs is to put Qtopia into a toolchain directory or other shared location so that multiple developers can build against the same configuration without having to build Qtopia for each machine.

    configure -device mydevice -sdk /opt/toolchains/mydevicetoolchain
    make
    make sdk

Note that an SDK does not include the files required to run Qtopia, only the files required to build third party applications. Most Qtopia applications are not suitable for building against an SDK as they reference files relative to the source tree and in an SDK those files are not present.

Installing into a sandbox

You can install an SDK into a sandbox. This is useful if the process that builds the SDK does not have access to the destination path.

To install into a sandbox you set the SDKSANDBOX variable.

    configure -device mydevice -sdk /opt/toolchains/mydevicetoolchain
    make
    make sdk SDKSANDBOX=/sandbox

This would install the SDK into /sandbox/opt/toolchains/mydevicetoolchain. Note that the SDK cannot be used from this location, it must be moved to /opt/toolchains/mydevicetoolchain before it is used.

Using a binary SDK

A binary SDK can be used like a combined build/source tree. As with development against a build tree there is no need to set environment variables to use the SDK. However it may be useful to include the bin directory in your PATH. You can simply run qtopiamake and make like usual.

Advanced binary SDK creation

A combination of x86 (native) and device (cross-compiled) SDKs is useful when building apps. The native build allows running on a fast, desktop system under QVFb and the device SDK allows creation of apps for the actual device.

To do this you must complete 2 builds. This example will create the native SDK first. Before that can be done the sources must be unpacked and suitable build directories created.

    tar zxf qtopia-phone-commercial-src-4.2.4.tar.gz
    mkdir build_native
    mkdir build_device

The native SDK includes an image so that the apps can be run under QVFb.

    cd build_native
    ../qtopia-phone-4.2.4/configure -sdk /opt/Qtopia/SDK/4.2.4/x86 -image /opt/Qtopia/SDK/4.2.4/x86/image
    make
    make install
    cd ..

The device SDK does not include an image since the apps are run on the device.

    cd build_device
    ../qtopia-phone-4.2.4/configure -device mydevice -sdk /opt/Qtopia/SDK/4.2.4/mydevice
    make
    make sdk
    cd ..

Note that there is some duplication in files between these directories. To save space the duplicate files can be symlinked together. A future version of Qtopia is expected to use a more space-efficient layout of files.

Using multiple SDKs

A third party project can only be built against a single SDK at a time. You should run make clean before switching between SDKs. To select the SDK to use, simply run the appropriate qtopiamake.

Here is how you would run under the native SDK created above.

    make clean
    /opt/Qtopia/SDK/4.2.4/x86/bin/qtopiamake
    make
    make install
    /opt/Qtopia/SDK/4.2.4/x86/bin/runqtopia

Here is how you would create a device package.

    make clean
    /opt/Qtopia/SDK/4.2.4/mydevice/bin/qtopiamake
    make
    make packages

See also Overviews.


Copyright © 2008 Nokia Qtopia Build System Documentation