| Home · Reference · User Guide · Internals |
Device profiles are a way to minimize the hassle of configuring for a device. A single directory contains all of the configuration information necessary to build for the device.
Profiles live in the devices directory in the source tree. They are activated by running configure -device foo.
There are a number of features. They are described by the file that implements them.
The single most annoying thing about compiling for a new device is that usually lots of configure arguments are required. These must be communicated to anyone wanting to compile for the device. A device profile can have a file named configure that specifies configure arguments.
When you run configure [args1] -device foo [args2] configure checks for <source>/devices/foo/configure and if it's found, configure re-launches itself with -device foo replaced by the contents of the file.
Here's a sample configure file (note that whitespace is interpreted by the shell so the newlines are not relevant).
-edition phone -xplatform mydev -arch arm -no-qvfb
-release -displaysize 240x320 -quicklaunch
-defaultbuttons phone
-extra-qtopiacore-config -plugin-kbd-mydev
-extra-qtopiacore-config -plugin-mouse-mydev
-prefix /opt/Qtopia
The ordering of arguments is significant. Anything specified before -device can be overridden by the device profile while anything after -device can override the device profile.
For example, the sample file above specifies -release. Here's what would happen if you passed -debug before and after -device foo.
This script (if it exists) is sourced before re-running configure and before Makefile calls Makefile.target. The suggested use is to setup paths to an appropriate cross compiler. The DEVICE_CONFIG_PATH variable is set to the path of the device profile so that you can locate files inside the device directory.
Since a typical behavior of the configure file is to set -xplatform it is useful to have a platform spec for the device. Device profiles can contain a mkspecs directory that is checked for -platform and -xplatform spec files. This is so that you do not have to modify the Qt depot in order to ensure your device can be built (though it is possible to move a spec file to Qt without having to modify the configure line).
For example, the mydev spec files are in it's configuration directory.
devices/mydev/mkspecs/qws/linux-mydev-g++/qmake.conf
devices/mydev/mkspecs/qws/linux-mydev-g++/qplatformdefs.h
There are mkspecs that ship with Qtopia Core. They are in qtopiacore/qt/mkspecs/qws. You should copy one that is similar to your device (eg. linux-arm-g++) and modify it to suit. Things to check are the name of the compiler, the compiler flags (especially optimization flags). You may also want the mkspec to specify a define that you can use to enable device-specific code in Qtopia Core and Qtopia.
Since these files are tied to a device it is useful to have them in the device profile. If these files are not present configure will look in the traditional location, <source>/src/libraries/qtopia/custom-<xplatform>.(h|cpp). See Hardware Configuration for more information about custom.h.
Every device needs a suitable defaultbuttons.conf. Use of this file onl* happens if -defaultbuttons is not passed to configure. See Keypad Button Behavior for a description of defaultbuttons.conf.
Configuration tweaks can be done here. This is read just after the configure-generated config.pri, before each .pro file is read.
This is for enabling and disabling projects as appropriate for the device. This is processed after general.pri and commercial.pri but before custom.pri and local.pri so that the user can still override the projects.
If the src directory exists, it is added as a project root (configure -build <source>/devices/foo/src). It is recommended to mimic the Qtopia source tree layout for ease of reference.
This file overrides the use of qconfig-qpe.h. It can define all it's own things or it can #include "qconfig-qpe.h" and override settings (watch out for dependencies if you do this though!).
This directory is used to provide device-specific help file overrides. It can only be used to override files in <source>/help.
Device profiles do not currently help you with the following items.
See also Overviews.
| Copyright © 2007 Trolltech | Qtopia Build System Documentation |