QtEmbedded开发介绍之配置参数篇
QtEmbedded开发介绍之配置参数篇上
经常有人会在BBS和QQ群上大喊:怎么裁剪Qt,怎么安装那么困难啊。
每当我看见时,都是非常无奈,其实Qt有套良好的配置安装机制,跟大多数linux程序一样,典型的先configure,然后make,最后make install三部曲。而如果要裁剪参数,其实可以在configure加上对应的参数来实现,通过合理的选择,完全可以做到满足项目的开发。对于嵌入式开发来说,资源是极其重要的,这就要求我们应该对应不同的项目开发,对Qte进行不同的裁剪来实现。
其实,在前面的减少Qt编译时间暨简单Qt裁剪已经对这个题目有了非常详细的概述,并且通过qconfig工具可以做到控件级的裁剪,但是如果能在configure阶段,能搞清楚参数,我想对于开发也是有很大的帮助。
为了与时俱进,本人的例子都是参照qt-embedded-linux-opensource-src-4.5.x系列。
当进入解压好的源码包后,使用./configure –help命令,可以获得相应帮助,那我们只要选取参数部分看看就OK
Configure options:
The defaults (*) are usually acceptable. A plus (+) denotes a default value
that needs to be evaluated. If the evaluation succeeds, the feature is
included. Here is a short explanation of each option:* -release ……….. Compile and link Qt with debugging turned off.
-debug …………. Compile and link Qt with debugging turned on.
-debug-and-release . Compile and link two versions of Qt, with and without
debugging turned on (Mac only).-developer-build…. Compile and link Qt with Qt developer options (including auto-tests exporting)
-opensource……… Compile and link the Open-Source Edition of Qt.
-commercial……… Compile and link the Commercial Edition of Qt.* -shared ………… Create and use shared Qt libraries.
-static ………… Create and use static Qt libraries.* -no-fast ……….. Configure Qt normally by generating Makefiles for all
project files.
-fast ………….. Configure Qt quickly by generating Makefiles only for
library and subdirectory targets. All other Makefiles
are created as wrappers, which will in turn run qmake.-no-largefile …… Disables large file support.
+ -largefile ……… Enables Qt to access files larger than 4 GB.* -no-exceptions ….. Disable exceptions on compilers that support it.
-exceptions …….. Enable exceptions on compilers that support it.-no-accessibility .. Do not compile Accessibility support.
* -accessibility ….. Compile Accessibility support.-no-stl ………… Do not compile STL support.
* -stl …………… Compile STL support.-no-sql-
… Disable SQL entirely.
-qt-sql-… Enable a SQL in the QtSql library, by default
none are turned on.
-plugin-sql-Enable SQL as a plugin to be linked to
at run time.Possible values for
:
[ db2 ibase mysql oci odbc psql sqlite sqlite2 tds ]-system-sqlite ….. Use sqlite from the operating system.
-no-qt3support ….. Disables the Qt 3 support functionality.
* -qt3support …….. Enables the Qt 3 support functionality.-no-xmlpatterns …. Do not build the QtXmlPatterns module.
+ -xmlpatterns ……. Build the QtXmlPatterns module.
QtXmlPatterns is built if a decent C++ compiler
is used and exceptions are enabled.-no-phonon ……… Do not build the Phonon module.
+ -phonon ………… Build the Phonon module.
Phonon is built if a decent C++ compiler is used.
-no-phonon-backend.. Do not build the platform phonon plugin.
+ -phonon-backend….. Build the platform phonon plugin.-no-svg ………… Do not build the SVG module.
+ -svg …………… Build the SVG module.-no-webkit ……… Do not build the WebKit module.
+ -webkit ………… Build the WebKit module.
WebKit is built if a decent C++ compiler is used.-no-scripttools …. Do not build the QtScriptTools module.
+ -scripttools ……. Build the QtScriptTools module.-platform target … The operating system and compiler you are building
on (qws/linux-x86-g++).See the README file for a list of supported
operating systems and compilers.-no-mmx ………… Do not compile with use of MMX instructions.
-no-3dnow ………. Do not compile with use of 3DNOW instructions.
-no-sse ………… Do not compile with use of SSE instructions.
-no-sse2 ……….. Do not compile with use of SSE2 instructions.-qtnamespace
Wraps all Qt library code in ‘namespace {…}’.
-qtlibinfixRenames all libQt*.so to libQt* .so. -D
…….. Add an explicit define to the preprocessor.
-I…….. Add an explicit include path.
-L…….. Add an explicit library path. -help, -h ………. Display this information.
Third Party Libraries:
-qt-zlib ……….. Use the zlib bundled with Qt.
+ -system-zlib ……. Use zlib from the operating system.
See http://www.gzip.org/zlib-no-gif ………… Do not compile the plugin for GIF reading support.
* -qt-gif ………… Compile the plugin for GIF reading support.
See also src/plugins/imageformats/gif/qgifhandler.h-no-libtiff …….. Do not compile the plugin for TIFF support.
-qt-libtiff …….. Use the libtiff bundled with Qt.
+ -system-libtiff …. Use libtiff from the operating system.
See http://www.libtiff.org-no-libpng ……… Do not compile in PNG support.
-qt-libpng ……… Use the libpng bundled with Qt.
+ -system-libpng ….. Use libpng from the operating system.
See http://www.libpng.org/pub/png-no-libmng ……… Do not compile the plugin for MNG support.
-qt-libmng ……… Use the libmng bundled with Qt.
+ -system-libmng ….. Use libmng from the operating system.
See http://www.libmng.com-no-libjpeg …….. Do not compile the plugin for JPEG support.
-qt-libjpeg …….. Use the libjpeg bundled with Qt.
+ -system-libjpeg …. Use libjpeg from the operating system.
See http://www.ijg.org-no-openssl …….. Do not compile support for OpenSSL.
+ -openssl ……….. Enable run-time OpenSSL support.
-openssl-linked …. Enabled linked OpenSSL support.-ptmalloc ………. Override the system memory allocator with ptmalloc.
(Experimental.)
Additional options:
-make
……. Add part to the list of parts to be built at make time.
(libs tools examples demos docs translations)
-nomake….. Exclude part from the list of parts to be built. -R
…….. Add an explicit runtime library path to the Qt
libraries.
-l…….. Add an explicit library. -no-rpath ………. Do not use the library install path as a runtime
library path.
+ -rpath …………. Link Qt libraries and executables using the library
install path as a runtime library path. Equivalent
to -R install_libpath-continue ………. Continue as far as possible if an error occurs.
-verbose, -v ……. Print verbose information about each step of the
configure process.-silent ………… Reduce the build output so that warnings and errors
can be seen more easily.* -no-optimized-qmake … Do not build qmake optimized.
-optimized-qmake …… Build qmake optimized.-no-nis ………… Do not compile NIS support.
* -nis …………… Compile NIS support.-no-cups ……….. Do not compile CUPS support.
* -cups ………….. Compile CUPS support.
Requires cups/cups.h and libcups.so.2.-no-iconv ………. Do not compile support for iconv(3).
* -iconv …………. Compile support for iconv(3).-no-pch ………… Do not use precompiled header support.
* -pch …………… Use precompiled header support.-no-dbus ……….. Do not compile the QtDBus module.
+ -dbus ………….. Compile the QtDBus module and dynamically load libdbus-1.
-dbus-linked ……. Compile the QtDBus module and link to libdbus-1.-reduce-relocations ….. Reduce relocations in the libraries through extra
linker optimizations (Qt/X11 and Qt for Embedded Linux only;
experimental; needs GNU ld >= 2.18).-no-separate-debug-info . Do not store debug information in a separate file.
* -separate-debug-info …. Strip debug information into a separate .debug file.
Qt for Embedded Linux only:
-xplatform target … The target platform when cross-compiling.
-no-feature-
Do not compile in .
-feature-.. Compile in . The available features
are described in src/corelib/global/qfeatures.txt-embedded …. This will enable the embedded build, you must have a
proper license for this switch to work.
Example values for : arm mips x86 generic-armfpa …………. Target platform is uses the ARM-FPA floating point format.
-no-armfpa ………. Target platform does not use the ARM-FPA floating point format.The floating point format is usually autodetected by configure. Use this
to override the detected value.-little-endian …… Target platform is little endian (LSB first).
-big-endian ……… Target platform is big endian (MSB first).-host-little-endian . Host platform is little endian (LSB first).
-host-big-endian …. Host platform is big endian (MSB first).You only need to specify the endianness when
cross-compiling, otherwise the host
endianness will be used.-no-freetype …….. Do not compile in Freetype2 support.
-qt-freetype …….. Use the libfreetype bundled with Qt.
* -system-freetype …. Use libfreetype from the operating system.
See http://www.freetype.org/-qconfig local …… Use src/corelib/global/qconfig-local.h rather than the
default (full).-depths
…… Comma-separated list of supported bit-per-pixel
depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and ‘all’.-qt-decoration-