Building Qt
From Texas Instruments Embedded Processors Wiki
Qte gitorious branch of TI
Link: http://qt.gitorious.org/qt/qt
branch: 4.6
Setting up Target before Qt Build
- Use the already built MLO, u-boot, uImage and filesystem under OMAP35x-PSP-SDK-xx.xx.xx.xx/images/ or rebuild as per DVSDK GSG
Current Latest Graphics DDK/Kernel Module Release: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_3_00/latest/index_FDS.html
- Please follow Graphics SDK GSG to get started on SGX
FileSystem:
- Use the PSP file system from OMAP35x-PSP-SDK-xx.xx.xx.xx or build as per GSG as pointed above
Qt git source: http://qt.gitorious.org/qt/qt
- Use 4.6 branch
- Patch
Note: This patch is tested on Qt branch 4.6 checkout: 99b19431e6846a36a65f23d21a95140a081d1f1a dated-Nov 12 2009
Code Sourcery Toolchain: http://www.codesourcery.com/sgpp/lite/arm/releases/2007q3 or later
- Please select the options Arm EABI, IA32 GNU/Linux
Note: For BeagleBoard, please use the same toolchain as the one used to compile your kernel & filesystem
Procedure:
- Please bringup your Omap3 EVM board. Follow the Getting Started Guide (GSG) as pointed above
Recommended Bootargs for OMAP3 EVM:
- For getting output on LCD:
setenv bootargs console=ttyS0,115200n8=noinitrd ip=dhcp rw root=/dev/nfs nfsroot=machine_ip:path_to_filesystem,nolock, rsize=1024,wsize=1024 mem=80M omapfb.vram=8M
- For getting output on DVI:
setenv bootargs console=ttyS0,115200n8=noinitrd ip=dhcp rw root=/dev/nfs nfsroot=machine_ip:path_to_filesystem,nolock, rsize=1024,wsize=1024 mem=80M omapfb.vram=8M omapfb.video_mode="1280x720MR-16@60" omap-dss.def_disp="dvi"
You need to execute the following command immediately after the board bring up only for DVI output.
fbset -depth 32 -rgba 8/16,8/8,8/0,8/24
Building Qt for OMAP35xx/AM35xx with OpenGL ES accelerated by SGX
Please look at Building Qt for OMAP35xx with OpenGL ES accelerated by SGX, which is an article dedicated to this configuration.
Building Qt for ARM only devices (OMAPL1/DM3xx/DM35xx) without OpenGL ES x.x & without SGX Acceleration
Since devices like OMAPL1 does not have SGX, the GFX SDK is not applicable for such devices. The OpenGL ES x.x support will be disabled for such devices in Qt
Step 1:
You can download the Qt SDK from following locations:
- Different branches of Qt Gitorious for getting the latest qt under development: http://qt.gitorious.org/qt/qt
- Qt stable releases: http://qt.nokia.com/downloads
Step 2:
Copy the qmake conf for OMAPL1
cp -R [qt-install-dir]/mkspecs/qws/linux-arm-g++/ [qt-install-dir]/mkspecs/qws/linux-omapl1-g++/
Fix/Add the paths of the header files in mkspecs/qws/linux-omapl1-g++/qmake.conf
# # qmake configuration for building with arm-linux-g++ # include(../../common/g++.conf) include(../../common/linux.conf) include(../../common/qws.conf) # modifications to g++.conf #Toolchain #Compiler Flags to take advantage of the ARM architecture QMAKE_CFLAGS_RELEASE = Please update this flag with your arm family specific compiler optimization options QMAKE_CXXFLAGS_RELEASE = Please update this flag with your arm family specific compiler optimization options QMAKE_CC = arm-none-linux-gnueabi-gcc QMAKE_CXX = arm-none-linux-gnueabi-g++ QMAKE_LINK = arm-none-linux-gnueabi-g++ QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++ # modifications to linux.conf QMAKE_AR = arm-none-linux-gnueabi-ar cqs QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy QMAKE_STRIP = arm-none-linux-gnueabi-strip load(qt_config)
Note: For a different toolchain, please change the qmake.conf above accordingly. e.g For Angstrom Toolchain, you may need to change arm-none-linux-gnueabi-gcc to arm-angstrom-linux-gnueabi-gcc
Step 3:
Use the following recommended options for configuring Qt:
./configure -prefix /opt/qt-embedded -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-omap3-g++ -depths 16,24,32 -no-cups -no-largefile -no-accessibility -no-openssl -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc –fast
Note:
- -prefix option in the configure above points to the path of the rootfs where qt-e to be installed
- For TouchScreen, you need to append the configure options "-qt-mouse-tslib" in above mentioned recommended options
Step 4: gmake & gmake install
Step 5:
Running the Qt Application:
For the commands below, I have installed my qt-embedded in the path: /opt/qt-embedded
[mailto:root@arago root@arago]:~# export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X1 1R6_SGX/lib:/usr/local/lib:/opt/qt-embedded/lib root@arago:~# ./<Any_Demo> -qws
General build instructions for other platforms
While Qt supports a variety of platforms with different versions there is a standard flow for the build process.
- Install the source package
- Adapt Qt 'mkspec' to cross-platform tools - usually changes compiler tool prefix
- Run Qt "configure" tool
- Run "make" process
- Install the libraries
Source packages are available from the download link. You might want to check Qt Tips for more info.
Make sure you have Perl installed. This is required by the Qt configure step.
Adapting 'mkspecs'
Easiest approach is to copy one of the folders in <your_qt>/mkspecs/qws that matches your target closely. Then modify all the compiler names and options as needed for your environment by editing qmake.conf. Following is a short example for OMAP3 using CodeSourcery toolchain. This assumes you have your toolchain installed and tested. Especially the path variable needs to changed so that Qt build process can locate the compiler tools named here. I don't recommend to use full path names here but that is of course possible too.
# include(../../common/g++.conf) include(../../common/linux.conf) include(../../common/qws.conf) # modifications to g++.conf QMAKE_CC = arm-none-linux-gnueabi-gcc QMAKE_CXX = arm-none-linux-gnueabi-g++ QMAKE_LINK = arm-none-linux-gnueabi-g++ QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++ # modifications to linux.conf QMAKE_AR = arm-none-linux-gnueabi-ar cqs QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy QMAKE_STRIP = arm-none-linux-gnueabi-strip load(qt_config)
Of course you can find many more settings in the common folder that you may have to adapt. You may also add additional include and lib dependencies or compiler optimisation options.
Use the new folder name as the -xplatform parameter in the following step (e.g. linux-omap3-g++).
Configuration Examples
Comment: examples below are taken from real-world tests but don't mean you shouldn't consider other options. Especially where modules are not build you might remove that option to get the full Qt functionality (e.g. -no-phonon was used in one case to reduce compile time as we had no need for phonon in our application demo).
Qt 4.5.x Embedded Linux: Configuration for OMAP-L137
#./configure -prefix /opt/qt -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-omapl1-mv-g++ -qt-kbd-usb -depths 16 -no-cups -no-largefile -no-accessibility -no-opengl -no-openssl
Qt 4.5.x WinCE: Configuration for OMAP3
Make sure that your path contains <wince_qt_dir>\bin. Then open a Visual Studio shell and enter:
configure.exe -platform win32-msvc2005 -xplatform wince60standard-armv4i-msvc2005
Here we assume that WinCE Platform Builder and the OMAP3 WinCE BSP are installed. Now type "nmake" inside a Platform Builder build shell to generate Qt DLLs. The DLLs maybe installed into C:/Windows on the WinCE file system or reside in the same folder as the Qt application (e.g. on SD card or USB disk). This is especially useful for testing.
For generating the run-time tree do this:
set INSTALL_ROOT=\some_path
nmake install
This will copy all relevant files into C:\some_path. From there copy to the WinCE target.
Qt 4.5.x Embedded Linux: Configuration for DM365 with Avnet LCD
If using the Avnet LCD kit, some patches need to be applied to the kernel. Follow the instructions on DM365 touchscreen with Qt.
For touchscreen support, ensure the following lines are in the gmake.conf file:
#modifications to include ts-lib QMAKE_INCDIR = /home/user/workdir/dm365/usr/include QMAKE_LIBDIR = /home/user/workdir/dm365/lib
Add the following lines to the /root/.profile file on the target. This sets the environment variables for touch screen support, and for Qt to use the second OSD window (/dev/fb2).
export QWS_MOUSE_PROTO=tslib:/dev/input/event0 export QWS_DISPLAY=LinuxFb:/dev/fb2
See Also
- Building Qt to make use of the Beagle board’s SGX GPU
- Beagle is the first officially verified Qt Board under "The Qt Board Verification Program" - March 02, 2010
- Qt_on_BeagleBoard

