The first article: http://user.qzone.qq.com/276546441/gift? Target = send_5th & senduin = 58720861
Environment: Ubuntu 8.04
Hard Disk Space: 40 GB
Qt code: 4.6.2 (: http://qt.nokia.com/downloads)
Steps:
A. Embedded Edition
1. Modify the file path to [QT-install-Dir]/mkspecs/qws/Linux-arm-G ++/qmake. conf:
# <Br/> # qmake configuration for building with arm-Linux-G ++ <br/> # </P> <p> include (.. /.. /common/g ++. conf) <br/> include (.. /.. /common/Linux. conf) <br/> include (.. /.. /common/qws. conf) </P> <p> # modify the macro definition in G ++ <br/> # Set the compilation flag using ARM advanced features <br/> qmake_cflags_release =-O3-March = armv7-a <br/>-mtune = cortex-a8 <br/>-mfpu = neon <br/>-mfloat-Abi = softfp <br/> qmake_cxxflags_release =-O3-March = armv7-a <br />-mtune = cortex-a8-mfpu = neon-mfloat-Abi = softfp </P> <p> # Set the cross-compilation toolchain <br/> # Cross the compilation tool is <br/> # http://www.codesourcery.com/sgpp/lite/arm <br/> # <br/> qmake_cc = arm-None-Linux-gnueabi-GCC <br/> qmake_cxx = arm-None-Linux -gnueabi-G ++ <br/> qmake_link = arm-None-Linux-gnueabi-G ++ <br/> qmake_link_shlib = arm-None-Linux-gnueabi-G ++ </P> <p> # modify Linux. macro definition in conf <br/> qmake_ar = arm-None-Linux-gnueabi-ar cqs <br/> qmake_objcopy = arm-None-Linux-gnueabi-objcopy <br/> qmake_strip = arm-None-Linux-gnueabi-strip </P> <p> load (qt_config)
2. Configure the QT script compilation Option
Go to the QT code root directory on the console and execute./configure-Prefix <path_to_nfs>-Embedded ARM-platform/qws/linux-x86-g ++
-Xplatform/qws/linux-omap3-g ++-Depths 16,24, 32-no-MMX
-No-3dnow-no-SSE-no-sse2-
No-glib-no-cups
-No-largefile-no-Accessibility-no-OpenSSL-
No-gtkstyle-QT-mouse-PC-QT-mouse-linuxtp
-QT-mouse-linuxinput-plugin-mouse-linuxtp-plugin-mouse-PC-fast
Note: 1. These configuration options are ti's reference configurations. You can increase or decrease them at will to test the effect,
2. You can view the specific functions of parameters through./configure -- help.
3. <path_to_nfs> is the full path of QT installed on the board. It is used to save various files generated by compilation.
3. troubleshooting methods
When a configuration error occurs, go to the tmp directory to enter the Temporary Folder that looks like QT and find the config. log file, which contains detailed error information. If no error occurs, run make and make install. If no error occurs, the compilation is successful. copy the file in <path_to_nfs> to the SD card of the Board with the same name and directory to use QT.
4. Version description
Qt of embedded implements X-server and X-client by itself, so it cannot coexist with existing desktop environments. In openembedded open-source projects, many tools that can be used in the X11 environment are not found to be usable in the embedded environment of QT. to use them, you can only compile QT into the X11 version of the base arm system. For detailed steps, refer to B.
B. X11 [2]
1. Compile Angstrom
The desktop environment Used in our board is angstrom. To compile QT X11, You need to compile the desktop environment according to the steps provided in [5]. Where is machine? = "Beagleboard" bitbake base-image; bitbake console-image x11-image after adding beagleboard-demo-image, may be directly bitbake beagleboard-demo-image. If the network speed is fast, the compilation process should be completed in over 10 hours.
2. Set the scratchbox2 Environment
Install scratchbox2 first, execute sudo apt-Get install help2man texi2html texinfo, and then execute sudo apt-Get install scratchbox2. After the installation is successful, modify configuration values in/usr/bin/sb2-build-libtool
-. /Configure-Prefix = $ home /. scratchbox2/$ target-build = $ (uname-m)-unknown-Linux-GNU <br/> +. /configure-host = x86-Prefix = $ home /. scratchbox2/$ target-build = $ (uname-m)-unknown-Linux-GNU
Sudo dpkg-reconfigure dash select No, modify/bin/sh to point to safe, otherwise the sb2-init cannot be executed.
In/etc/sysctl. conf, set VM. mmap_min_addr = 0. Restart after the setting is complete, otherwise the sb2-init cannot be executed.
In ~ /OE/Angstrom-dev/staging/armv7a-angstrom-linux-gnueabi directory execute sb2-init-C/usr/bin/qemu-arm Angstrom-Beagle ~ /OE/Angstrom-dev/Cross/armv7a/bin/ARM-Angstrom-Linux-gnueabi-GCC. The last parameter is the path of the compiler tool chain, you can use/opt/codesourcery/ARM-None-Linux-gnueabi/arm-2007q3/bin/ARM-Angstrom-Linux-gnueabi-GCC (this is the tool path I have configured for cross-compilation))
3. Compile QT X11
Modify/qws/Linux-arm-G ++/qmake. conf
# <Br/> # qmake configuration for Linux-G ++ <br/> # </P> <p> makefile_generator = UNIX <br/> template = app <br/> config + = QT warn_on release incremental link_prolactin <br/> QT + = core GUI <br/> qmake_incremental_style = sublib </P> <p> include (.. /.. /common/g ++. conf) <br/> include (.. /.. /common/Linux. conf) <br/> # modifications to G ++. conf </P> <p> qmake_cc = sb2 GCC <br/> qmake_cxx = sb2 g ++ <br/> qmake_link = sb2 g ++ <br/> qmake_link_shlib = sb2 g ++ </P> <p> # modifications to Linux. conf <br/> qmake_ar = sb2 ar cqs <br/> qmake_objcopy = sb2 objcopy <br/> qmake_strip = sb2 strip <br/> load (qt_config)
Modify the configure script file in the QT root directory, where the row number is incorrect.
If [-n "$ pkg_config"] & $ pkg_config-exists fontconfig 2>/dev/NULL; then <br/> qt_cflags_fontconfig = '$ pkg_config-cflags fontconfig 2>/dev/null' <br/> qt_libs_fontconfig =' $ pkg_config-libs fontconfig 2>/dev/null'
Is used to configure the path of the header file of the font library.
Diff-Git A/configure B/configure <br/> index 3f3e55a .. 54de96b 100755 <br/> --- A/configure <br/> ++ B/configure <br/> @-5115,6 + 5115,10 @ if ["$ platform_x11" =" yes "]; then <br/> If [-n "$ pkg_config"] & $ pkg_config-exists fontconfig 2>/dev/NULL; then <br/> qt_cflags_fontconfig = '$ pkg_config-cflags fontconfig 2>/dev/null' <br/> qt_libs_fontconfig =' $ pkg_config-libs fontconfig 2>/dev/null' <br/> + If $ pkg_config-exists FreeType2 2>/dev/NULL; then <br/> + token = "$ comment '$ pkg_config-cflags FreeType2>/dev/null'" <br/> + qt_libs_fontconfig = "$ qt_libs_fontconfig' $ pkg_config-libs freeType2 2>/dev/null' "<br/> + FI <br/> else <br/> qt_cflags_fontconfig = <br/> qt_libs_fontconfig ="-lfreetype-lfontconfig"
Run./configure-Prefix <path_to_nfs>-arch arm-xplatform PWS/Linux-arm-G ++-force-PKG-config to complete the configuration. Finally, execute make and make install. Global/qlibraryinfo appears when you execute make. CPP: 490: Error: expected primary-expression before '/'token error. Modify elf_interpreter of the error location, is "/lib/ld-linux.so.2" (This value can be obtained from-delf_interpreter = in makefile.
Refer:
1. http://processors.wiki.ti.com/index.php/Building_Qt
2. http://labs.trolltech.com/blogs/2009/11/20/building-qt-to-make-use-of-the-beagle-boards-sgx-gpu/
3. http://labs.trolltech.com/blogs/2010/02/05/qtx11-bring-up-on-tegra2-with-full-opengl-es-2-support
4. http://labs.trolltech.com/blogs/2009/09/10/cross-compiling-qtx11/
5. http://www.angstrom-distribution.org/building-angstrom