1. 程式人生 > >QT和QT-embedded的配置選項_裁剪(簡易翻譯)

QT和QT-embedded的配置選項_裁剪(簡易翻譯)

前階段沒少編譯QT和QTembedded,這是我的工作文件中的部分。

This is the Qt for Embedded Linux Open Source Edition.

Usage: configure [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]

[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-datadir <dir>] [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>] [-demosdir <dir>] [-buildkey <key>] [-release] [-debug] [-debug-and-release] [-shared] [-static] [-no-fast] [-fast] [-no-largefile] [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility] [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>] [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support] [-platform] [-D <string>] [-I <string>] [-L <string>] [-help] [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-system-libtiff] [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng] [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>] [-no-make <part>] [-R <string>] [-l <string>] [-no-rpath] [-rpath] [-continue] [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv] [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2] [-qtnamespace <namespace>] [-separate-debug-info] [-armfpa] [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-scripttools] [-scripttools] [additional platform specific options (see below)]

Installation options:

These are optional, but you may specify install directories.
-prefix <dir> ...... This will install everything relative to <dir>

(default /usr/local/Trolltech/QtEmbedded-4.5.0)
-hostprefix [dir] .. Tools and libraries needed when developing
applications are installed in [dir]. If [dir] is not given, the current build directory will be used.
-prefix-install .... Force a sandboxed "local" installation of
Qt. This will install into /usr/local/Trolltech/QtEmbedded-4.5.0, if this option is disabled then some platforms will attempt a "system" install by placing default values to be placed in a system location other than PREFIX.
You may use these to separate different parts of the install:
-bindir <dir> ......... Executables will be installed to <dir>

(default PREFIX/bin)
-libdir <dir> ......... Libraries will be installed to <dir>

(default PREFIX/lib)
-docdir <dir> ......... Documentation will be installed to <dir>

(default PREFIX/doc)
-headerdir <dir> ...... Headers will be installed to <dir>

(default PREFIX/include)
-plugindir <dir> ...... Plugins will be installed to <dir>

(default PREFIX/plugins)
-datadir <dir> ........ Data used by Qt programs will be installed to <dir>

(default PREFIX)
-translationdir <dir> . Translations of Qt programs will be installed to <dir>

(default PREFIX/translations)
-sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>

(default PREFIX/etc/settings)
-examplesdir <dir> .... Examples will be installed to <dir>

(default PREFIX/examples)
-demosdir <dir> ....... Demos will be installed to <dir>

(default PREFIX/demos)
You may use these options to turn on strict plugin loading.
-buildkey <key> .... Build the Qt library and plugins using the specified

<key>. When the library loads plugins, it will only load those that have a matching key.

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,編譯好的qt-embedded不能用於除錯程式。
-debug ............. Compile and link Qt with debugging turned on.
#編譯連結時允許使用debug,編譯好的qt-embedded只能用於除錯程式。
-debug-and-release ... Compile and link two versions of Qt, with and without
debugging turned on (Mac only).
-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.
#正常速度編譯Qt
-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.
#快速編譯Qt,只為庫和子目錄目標生成Makefile。所有其它的Makefile被打包建立,依次進行qmake。
-no-largefile ...... Disables large file support.
#關閉大檔案支援
+ -largefile ......... Enables Qt to access files larger than 4 GB.
#大檔案(大於4G)支援
-no-exceptions ..... Disable exceptions on compilers that support it.
#關閉異常支援
-exceptions ........ Enable exceptions on compilers that support it.
#異常支援
-no-accessibility .. Do not compile Accessibility support.
#關閉對windows active控制元件支援
-accessibility ..... Compile Accessibility support.
#windows active控制元件支援
-no-stl ............ Do not compile STL support.
#關閉c++標準庫支援
-stl ............... Compile STL support.
#c++標準庫支援
-no-sql-<driver> ... Disable SQL <driver> entirely.

#完全禁止SQL<driver>

-qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default

none are turned on.
#開啟QtSql庫中SQL<driver>支援,預設無<driver>開啟。

-plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to

at run time.
Possible values for <driver>: [ db2 ibase mysql oci odbc psql sqlite sqlite2 tds ]

#開啟SQL<driver>支援,編譯為執行時連結的外掛庫。

-system-sqlite ..... Use sqlite from the operating system.
#使用作業系統自帶的sqlite
-no-qt3support ..... Disables the Qt 3 support functionality.
#關閉Qt3程式支援
-qt3support ........ Enables the Qt 3 support functionality.
#Qt3程式支援
-no-xmlpatterns .... Do not build the QtXml Patterns module.

#不編譯QtXml模式模組

+ -xmlpatterns ....... Build the QtXml Patterns module.

QtXml Patterns is built if a decent C++ compiler is used and exceptions are enabled.

#編譯QtXml模式模組,前提是使用標準C++編譯器和開啟了異常支援。

-no-phonon ......... Do not build the Phonon module.
#不編譯phonon模組
+ -phonon ............ Build the Phonon module.
Phonon is built if a decent C++ compiler is used.
#編譯phonon模組,前提是使用標準c++編譯器。
-no-phonon-backend.. Do not build the platform phonon plugin.
#不編譯平臺phonon外掛庫。
+ -phonon-backend..... Build the platform phonon plugin.
#編譯平臺phonon外掛庫。
-no-svg ............ Do not build the SVG module.
#不編譯SVG(可放縮的向量圖形)模組。
+ -svg ............... Build the SVG module.
#編譯SVG模組
-no-webkit ......... Do not build the WebKit module.

#不編譯WebKit模組。WebKit是一個開源瀏覽器網頁排版引擎。

+ -webkit ............ Build the WebKit module.

#編譯WebKit模組。

WebKit is built if a decent C++ compiler is used.

-no-scripttools .... Do not build the QtScriptTools module.

#不編譯QtScriptTools模組。

+ -scripttools ....... Build the QtScriptTools module.

#編譯QtScriptTools模組。

-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.
#不編譯MMX(MultiMedia eXtensions(多媒體擴充套件))。

-no-3dnow .......... Do not compile with use of 3DNOW instructions.
#不編譯3dnow,3dnow是支援單精度浮點數的向量運算,用於增強x86架構的計算機在三維影象處理上的效能。
-no-sse ............ Do not compile with use of SSE instructions.
#不編譯sse,sse是MMX的擴充指令集。
-no-sse2 ........... Do not compile with use of SSE2 instructions.
-qtnamespace <name> Wraps all Qt library code in 'namespace <name> {...}'.

-qtlibinfix <infix> Renames all libQt*.so to libQt*<infix>.so.

-D <string> ........ Add an explicit define to the preprocessor.

-I <string> ........ Add an explicit include path.

#手動增加標頭檔案絕對路徑
-L <string> ........ Add an explicit library path.

#手動增加庫檔案絕對路徑
-help, -h .......... Display this information.
#顯示配置幫助資訊
Third Party Libraries:

-qt-zlib ........... Use the zlib bundled with Qt.
#使用Qt自帶的zlib。zlib是個支援gzip檔案格式*.gz的函式庫。
+ -system-zlib ....... Use zlib from the operating system.
#使用作業系統自帶的zlib。
See
http://www.gzip.org/zlib


-no-gif ............ Do not compile the plugin for GIF reading support.
#不編譯GIF圖片支援外掛庫。
-qt-gif ............ Compile the plugin for GIF reading support.
#編譯GIF支援外掛庫。
See also src/plugins/imageformats/gif/qgifhandler.h
-no-libtiff ........ Do not compile the plugin for TIFF support.
#不編譯TIFF(標籤影象檔案格式)支援外掛庫。
-qt-libtiff ........ Use the libtiff bundled with Qt.
#使用Qt打包的libtiff。
+ -system-libtiff .... Use libtiff from the operating system.
#使用作業系統自帶的libtiff。
See
http://www.libtiff.org


-no-libpng ......... Do not compile in PNG support.
#不編譯PNG支援,PNG(Portable Network Graphics)行動式網路圖片。
-qt-libpng ......... Use the libpng bundled with Qt.
#使用Qt打包的libpng。
+ -system-libpng ..... Use libpng from the operating system.
#使用作業系統自帶的libpng。
See http://www.libpng.org/pub/png


-no-libmng ......... Do not compile the plugin for MNG support.
#不編譯MNG支援外掛庫,MNG是多幀PNG動畫圖形格式,功能類似GIF。目前多數主流瀏覽器均不直接支援MNG。
-qt-libmng ......... Use the libmng bundled with Qt.
#使用Qt打包的libmng。
+ -system-libmng ..... Use libmng from the operating system.
#使用作業系統自帶的libmng。
See http://www.libmng.com

-no-libjpeg ........ Do not compile the plugin for JPEG support.
#不編譯JPEG支援外掛庫。
-qt-libjpeg ........ Use the libjpeg bundled with Qt.
#使用Qt打包的libjpeg。
+ -system-libjpeg .... Use libjpeg from the operating system.
#使用作業系統自帶的libjpeg。
See http://www.ijg.org

-no-openssl ........ Do not compile support for OpenSSL.
#不編譯OpenSSL支援,OpenSSL是套開放原始碼的SSL套件,實現了基本的傳輸層資料加密功能,但其授權書條款與GPL有衝突。
+ -openssl ........... Enable run-time OpenSSL support.
#開啟執行時OpenSSL支援。
-openssl-linked .... Enabled linked OpenSSL support.
#開啟連結OpenSSL支援。
-ptmalloc .......... Override the system memory allocator with ptmalloc.
(Experimental.)
Additional options:

. -make <part> ....... Add part to the list of parts to be built at make time.

(libs tools examples demos docs translations)
-nomake <part> ..... Exclude part from the list of parts to be built.

. -R <string> ........ Add an explicit runtime library path to the Qt

libraries.
-l <string> ........ 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
-verbose, -v ....... Print verbose information about each step of the
configure process.
#在配置的過程中,對每一步都打印出詳細的資訊。
-continue .......... Continue as far as possible if an error occurs.
#當錯誤出現時儘可能繼續編譯。
-silent ............ Reduce the build output so that warnings and errors
can be seen more easily.
-no-optimized-qmake ... Do not build qmake optimized.
#不生成優化過的qmake。
-optimized-qmake ...... Build qmake optimized.
#生成優化過的qmake。
-no-nis ............ Do not compile NIS support.
#不編譯NIS支援,NIS(網路資訊服務)是一個提供目錄服務的RPC(遠端過程呼叫)應用服務。
-nis ............... Compile NIS support.
#NIS支援。
-no-cups ........... Do not compile CUPS support.
#不編譯CUPS支援,
-cups .............. Compile CUPS support.
#CUPS支援。
Requires cups/cups.h and libcups.so.2.
-no-iconv .......... Do not compile support for iconv(3).
#不編譯iconv支援,iconv是一個計算機程式以及一套應用程式程式設計介面的名稱。它的作用是在多種國際編碼格式之間進行文字內碼的轉換。
-iconv ............. Compile support for iconv(3).
#iconv支援
-no-pch ............ Do not use precompiled header support.
#不使用預編譯過的標頭檔案支援。
-pch ............... Use precompiled header support.
#預編譯過的標頭檔案支援。預編譯頭就是把一個工程中的一部分程式碼,預先編譯好放在一個檔案裡(通常以.pch為副檔名),這個檔案就稱為預編譯標頭檔案。這些預先編譯好的程式碼在工程開發的過程中不會被經常改變。如果這些程式碼被修改,則需要重新編譯生成預編譯標頭檔案。
-no-dbus ........... Do not compile the QtDBus module.
#不編譯QtDBus模組,D-BUS是一個提供簡單的應用程式互相通訊的途徑的自由軟體專案,允許程式在其上註冊以提供服務給其他的程式,同時也提供客戶端程式查詢有哪些服務是獲得的。
+ -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
#QtDBus模組支援且動態載入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-<feature> Do not compile in <feature>.

-feature-<feature> .. Compile in <feature>. The available features

are described in src/corelib/global/qfeatures.txt
-embedded <arch> .... This will enable the embedded build, you must have a

proper license for this switch to work.
Example values for <arch>: 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.
#不編譯Freetype2支援,Freetype2是一個簡單的跨平臺的字型繪製引擎,可以被用在諸如影象庫、展出伺服器、字型轉換工具、影象文字產生工具等多種其它產品上。
-qt-freetype ........ Use the libfreetype bundled with Qt.
#使用Qt打包的libfreetype。
-system-libfreetype. Use libfreetype from the operating system.
#使用作業系統自帶的libfreetype。
See http://www.freetype.org/

-qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the
default (full).
-depths <list> ...... Comma-separated list of supported bit-per-pixel

depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and 'all'.
-qt-decoration-<style> ....Enable a decoration <style> in the QtGui library,

by default all available decorations are on.
Possible values for <style>: [ styled windows default ]

-plugin-decoration-<style> Enable decoration <style> as a plugin to be

linked to at run time.
Possible values for <style>: [ default styled windows ]

-no-decoration-<style> ....Disable decoration <style> entirely.

Possible values for <style>: [ styled windows default ]

-no-opengl .......... Do not support OpenGL.
-opengl <api> ....... Enable OpenGL ES support

With no parameter, this will attempt to auto-detect OpenGL ES 1.x
or 2.x. Use es1, es1cl or es2 for <api> to override auto-detection. NOTE: A QGLScreen driver for the hardware is required to support

OpenGL ES on Qt for Embedded Linux.
-qt-gfx-<driver> ... Enable a graphics <driver> in the QtGui library.

#開啟QtGui庫中的圖形驅動支援。

Possible values for <driver>: [ linuxfb transformed qvfb vnc multiscreen ]

-plugin-gfx-<driver> Enable graphics <driver> as a plugin to be

linked to at run time.
Possible values for <driver>: [ ahi directfb hybrid linuxfb powervr qvfb transformed vnc ]

-no-gfx-<driver> ... Disable graphics <driver> entirely.

Possible values for <driver>: [ linuxfb transformed qvfb vnc multiscreen ]

-qt-kbd-<driver> ... Enable a keyboard <driver> in the QtGui library.

#開啟QtGui庫中的鍵盤驅動支援。

Possible values for <driver>: [ tty usb sl5000 yopy vr41xx qvfb ]

-plugin-kbd-<driver> Enable keyboard <driver> as a plugin to be linked to

at runtime.
Possible values for <driver>: [ linuxis sl5000 usb vr41xx yopy ]

-no-kbd-<driver> ... Disable keyboard <driver> entirely.

Possible values for <driver>: [ tty usb sl5000 yopy vr41xx qvfb ]

-qt-mouse-<driver> ... Enable a mouse <driver> in the QtGui library.

#開啟QtGui庫中的滑鼠驅動支援。

Possible values for <driver>: [ pc bus linuxtp yopy vr41xx tslib qvfb ]

-plugin-mouse-<driver> Enable mouse <driver> as a plugin to be linked to

at runtime.
Possible values for <driver>: [ bus linuxis linuxtp pc tslib vr41xx yopy ]

-no-mouse-<driver> ... Disable mouse <driver> entirely.

Possible values for <driver>: [ pc bus linuxtp yopy vr41xx tslib qvfb ]

-iwmmxt ............ Compile using the iWMMXt instruction set
(available on some XScale CPUs).
-no-glib ........... Do not compile Glib support.
#不編譯Glib支援。
+ -glib .............. Compile Glib support.

#GNOME的Glib支援。

1. 安裝交叉編譯器。利用友善之臂自帶的交叉編譯器。
將arm-linux-gcc-4.3.2.tgz 放在 /root下,執行如下操作
#cd /root
#tar xvzf arm-linux-gcc-4.3.2.tgz –C /
#gedit /root/.bashrc
在bashrc最後一行新增 export PATH=$PATH:/usr/local/arm/4.3.2/bin
#source /root/.bashrc
#arm-linux-gcc -v
檢視交叉編譯器版本為4.3.2

2. 編輯tslib對觸控式螢幕的支援
將tslib1.4.tar.gz 放在/root 下,解壓並編譯:
# cd /root
# tar zxvf tslib1.4.tar.gz
# cd tslib
# ./autogen.sh
# ./configure –prefix=/usr/local/tslib/ –host=arm-linux ac_cv_func_malloc_0_nonnull=yes
# make
# make install

3. 配置QtE4.8
將qt-everywhere-opensource-src-4.8.0.tar.gz壓縮包放在/opt下,解壓:
#cd /opt
#tar zxvf qt-everywhere-opensource-src-4.8.0.tar.gz
#mv qt-everywhere-opensource-src-4.8.0 qt-4.8.0-arm
#cd qt-4.7.0-arm
3.1製作一個配置指令碼
#gedit autoconfig.sh
編輯檔案如下:

#!/bin/bash

./configure \
-prefix /usr/local/Trolltech/QtEmbedded-4.8.2-arm \
-opensource \
-confirm-license \
-release -shared \
-embedded arm \
-xplatform qws/linux-arm-g++ \
-depths 16,18,24 \
-fast \
-optimized-qmake \
-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-zlib \
-qt-libpng \
-qt-freetype \
-little-endian -host-little-endian \
-no-qt3support \
-no-libtiff -no-libmng \
-no-opengl \
-no-mmx -no-sse -no-sse2 \
-no-3dnow \
-no-openssl \
-no-webkit \
-no-qvfb \
-no-phonon \
-no-nis \
-no-opengl \
-no-cups \
-no-glib \
-no-xcursor -no-xfixes -no-xrandr -no-xrender \
-no-separate-debug-info \
-nomake examples -nomake tools -nomake docs \
-qt-mouse-tslib
-I/usr/local/tslib/include \
-L/usr/local/tslib/lib

exit

3.2生成Makefile檔案並編譯安裝
#chmod 755 autoconfig.sh
#./autoconfig.sh
#gmake
#gmake install

3.3 移植到mini2440
安裝完成後 將/usr/local/Trolltech/QtEmbedded-4.8.0-arm/lib/fonts中的字型全部刪除 將 wenquanyi_120_50.qpf字型複製到fonts下:
#rm –rf /usr/local/Trolltech/QtEmbedded-4.8.0-arm/lib/fonts/*
#cp wenquanyi_120_50.qpf /usr/local/Trolltech/QtEmbedded-4.8.0-arm/lib/fonts/
3.4 製作開發板檔案系統
將root_qtopia-20100108.tar.gz 和 mkyaffs2image.tgz放在/root下。刪除qtopia圖形介面系統,刪除root資料夾下佔儲存較大的檔案。複製/usr/local/Trolltech/QtEmbedded-4.8.0-arm/lib 資料夾到 /root/root_qtopia/ usr/local/Trolltech/QtEmbedded-4.8.0-arm, 複製 /usr/local/tslib下所有內容到 /root/root_qtopia/usr/local/,修改觸控式螢幕配置檔案 ts.conf, 修改環境變數,修改自啟動檔案 /root/root_qtopia/etc/init.d/rcS。最後將mkyaffs2image 工具生成檔案系統映象。
#cd /root
#tar zxvf root_qtopia-20100108.tar.gz
#tar zxvf mkyaffs2image.tgz
#cd root_qtopia
#rm –rf opt/Qtopia
#rm –rf root/Documents/*
#mkdir -p usr/local/Trolltech/QtEmbedded-4.8.0-arm
#cp –r /usr/local/Trolltech/QtEmbedded-4.8.0-arm/lib usr/local/Trolltech/QtEmbedded-4.8.0-arm
#cp –r /usr/local/tslib/* usr/local/
#gedit usr/local/etc/ts.conf
#gedit etc/profile
#gedit etc/init.d/rcS
#cd /root
#mkyaffs2image root_qtopia root_qt-4.8.0.img
usr/local/etc/ts.conf: 取消註釋 module_raw input
etc/profile:在最後新增
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.8.0-arm
export T_ROOT=/usr/local
export PATH=$QTDIR/bin:$PATH
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
export LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR/lib
etc/init.d/rcS:
刪除:
/bin/qtopia &
echo ” ” > /dev/tty1
echo “Starting Qtopia, please waiting…” > /dev/tty1
新增:
source /etc/profile
echo ” ” > /dev/tty1
echo “Starting touch calibrate ” > /dev/tty1
echo ” ” > /dev/tty1
sleep 1
/usr/local/bin/ts_calibrate &

3.5 下載核心,檔案系統到mini2440
linux-2.6.32.img
root_qt-4.8.0.img
至此Qt4.8.0移植完成..

轉自:http://blog.csdn.net/embeddedman/article/details/7423107

$ git clone https://github.com/kergoth/tslib
編譯過程如下:
$ ./autogen.sh
$ #./configure --host=arm-linux --prefix=/home/latelee/lib/tslib
$ sudo  ./configure --prefix=/usr/local/tslib/ --host=arm-linux-gnueabihf ac_cv_func_malloc_0_nonnull=yes

$ make
$ make install

下載:qt-creator-linux-x86_64-opensource-2.5.2.bin

chmod +x qt-creator-linux-x86_64-opensource-2.5.2.bin

./qt-creator-linux-x86_64-opensource-2.5.2.bin

大家知道在windows下使用qtcreator整合IDE開發環境開發Qt程式,甚至是其他與Qt無關的程式,在此過程中大家也可能感受到了它的魅力,呵呵,那麼,各位朋友有沒有使用它在Linux下開發自己的程式了?更有甚者,用它來交叉編譯arm程式了?答案是可能的,而且相當方便。好了,下面我來帶大家感受它的魅力吧!!!

一、下載安裝Linux下的QtCreator安裝包(如:qt-creator-linux-x86-opensource-2.4.1.bin)網址:http://qt.nokia.com/downloads/qt-creator-binary-for-linux-x11-32-bit;大家根據自己的系統選擇是32位的還是64位的安裝包;

二、解壓上文的安裝包

  1、修改安裝包的可執行許可權;

[[email protected] ~]# chmod +x qt-creator-linux-x86-opensource-2.4.1.bin

  2、安裝qtcreator

[[email protected] ~]# ./qt-creator-linux-x86-opensource-2.4.1.bin
  3、就會出現安裝嚮導;

接下來的安裝就如同windows下按章軟體那麼簡單,在此不再囉嗦。

三、配置Qtcreator環境

  進行此步驟的前提是你的Linux系統編譯安裝了qt庫,庫的安裝步驟我就不介紹了。

  注意:如果你是隻做x86 pc機下配置,安裝qt庫的時候就是常規的編譯安裝qt庫,如果你是移植相關的qt程式程式碼到arm下執行,那麼qt就得交叉編譯,交叉編譯就得安裝交叉編譯器;我的目錄為:/opt/toolchain/4.4.3。

  下面我將介紹交叉編譯qt庫:

  1、qt-everywhere-opensource-src-4.6.4.tar.gz(我的qt庫安裝包,qt.nokia.com有下載)

  2、交叉編譯工具鏈:(我的友善之臂提供arm-linux-gcc4.4.3)

   我的安裝目錄如下:

/opt/toolchain/4.4.3/,進入交叉編譯器的bin目錄,你就會發現:
arm-linux-addr2line     arm-none-linux-gnueabi-addr2line
arm-linux-ar            arm-none-linux-gnueabi-ar
arm-linux-as            arm-none-linux-gnueabi-as
arm-linux-c++           arm-none-linux-gnueabi-c++
arm-linux-cc            arm-none-linux-gnueabi-cc
arm-linux-c++filt       arm-none-linux-gnueabi-c++filt
arm-linux-cpp           arm-none-linux-gnueabi-cpp
arm-linux-ct-ng.config  arm-none-linux-gnueabi-ct-ng.config
arm-linux-g++           arm-none-linux-gnueabi-g++
arm-linux-gcc           arm-none-linux-gnueabi-gcc
arm-linux-gcc-4.4.3     arm-none-linux-gnueabi-gcc-4.4.3
arm-linux-gccbug        arm-none-linux-gnueabi-gccbug
arm-linux-gcov          arm-none-linux-gnueabi-gcov
arm-linux-gprof         arm-none-linux-gnueabi-gprof
arm-linux-ld            arm-none-linux-gnueabi-ld
arm-linux-nm            arm-none-linux-gnueabi-nm
arm-linux-objcopy       arm-none-linux-gnueabi-objcopy
arm-linux-objdump       arm-none-linux-gnueabi-objdump
arm-linux-populate      arm-none-linux-gnueabi-populate
arm-linux-ranlib        arm-none-linux-gnueabi-ranlib
arm-linux-readelf       arm-none-linux-gnueabi-readelf
arm-linux-size          arm-none-linux-gnueabi-size
arm-linux-strings       arm-none-linux-gnueabi-strings
arm-linux-strip         arm-none-linux-gnueabi-strip

等等。

  3、在linux 下/opt目錄建立自己的qt庫編譯目錄,我的安裝如下:

[[email protected] opt]# mkdir qt4.6.4_src

然後將qt-everywhere-opensource-src-4.6.4.tar.gz拷貝至qt4.6.4_src目錄;

進入qt4.6.4_src目錄,在此目錄下建立指令碼,這個指令碼方便大家一鍵編譯、安裝啦

[[email protected] qt4.6.4_src]# vim build-all

內容如下:

#/bin/bash

export PATH=/opt/toolchain/4.4.3/bin:$PATH
export TB_CC_PREFIX=arm-linux-
export TOOLCHAIN=/opt/toolchain/4.4.3
export PKG_CONFIG_PREFIX=$TOOLCHAIN/arm-none-linux-gnueabi


rm -fr qt-everywhere-opensource-src-4.6.4
rm -fr Qt4.6.4_forArm

tar xfvz qt-everywhere-opensource-src-4.6.4.tar.gz

cd qt-everywhere-opensource-src-4.6.4

echo yes | ./configure -opensource -embedded arm -xplatform qws/linux-arm-g++  -no-webkit -qt-libtiff -qt-libmng  -qt-mouse-tslib -q
t-mouse-pc -no-mouse-linuxtp -prefix /opt/Qt4.6.4_forArm   -I /usr/local/arm/tslib/tslib/include -L /usr/local/arm/tslib/tslib/lib

make 2>&1 | tee ../qte4.6.4Makelog && make install

儲存退出後修改指令碼的可執行許可權:chmod +x buid-all;

4、./build-all執行咯,沒錯誤的話就可以安裝成功了,由於本人在build-all指令碼制定安裝目錄為:/opt/Qt4.6.4_forArm,所以就可以在此目錄下找到相關的安裝庫檔案等等咯!

這裡提示大家,交叉編譯qt庫之前最好交叉編譯安裝tslib,哈哈,這裡不做介紹,可以參考本人其他博文()。

5、接下來就是配置qtcreator交叉環境咯,方便大家開發arm下的qt應用程式;Linux下啟動qtcreator:


配置針對arm的交叉編譯環境:

由於上文提到本人的Qt交叉編譯暗轉的路徑為:/opt/Qt4.6.4_forArm,進入此目錄可以看到裡面的bin目錄,進入bin目錄可可以發現qmake了吧,

ok後,緊接著就是設定交叉工具鏈:

設定完成後,就可以開啟qt自帶的例子工程,進行編譯了。

寫此文的時候參考了天嵌科技出品--Qt程式開發完全手冊(上)之24小時超級版本_第二版_20091216.pdf,在此表示感謝,時間倉促,難免疏漏。

相關推薦

QTQT-embedded配置選項_裁剪簡易翻譯

前階段沒少編譯QT和QTembedded,這是我的工作文件中的部分。 This is the Qt for Embedded Linux Open Source Edition. Usage: configure [-prefix <dir>] [-prefi

Qt】Qt5.8交叉編譯配置選項詳解./configure --help

Usage:  configure [options] [assignments]Configure understands variable assignments like VAR=value on the command line.These override any

Tomcat學習—Tomcat的簡介目錄以及配置文件介紹Windows環境

系統 並發 manager htm 輕量級 管理 集群 web.xml 虛擬目錄 今天學習TOMCAT,主要學習的是Tomcat的目錄結構,配置文件!1:Tomcat簡介Tomcat 服務器是一個免費的開放源代碼的Web 應用服務器,屬於輕量級應用服務器,在中小型系統和並發

安裝配置OpenStack客戶端Jesse翻譯

 安裝和配置OpenStack客戶端(Jesse翻譯)原文來自icehouse的OpenStack文件 回憶:在前面部分,你已經使用了keystone客戶端。 你必須安裝客戶端工具去完成剩餘的安裝工作 概述 你可以使用OpenStack命令列去執行

對於Qt中QStringchar*之間的互相轉換問題系列二

對於Qt,雖說對C++全部相容,但是一旦涉及到和介面的資料的互動操作,難免涉及到char*和QString的轉換問題,轉換的過程很簡單,這裡總結了一下網上提供的最簡單的一個方法: 從char*轉成QString型別: 使用fromLocal8Bit方法進行轉換: char * te

QtQt creater 一些細微的小差別

最近,專案方面需要將一個原本用VS+Qt開發的介面移植到Qt Creator上面。在這個過程中遇到了一些bug然後不斷debug,打算把它們分點寫下來,希望對有同樣需求的朋友能有一些幫助。 目前Qt的開發環境一般有兩種,一種是直接使用Qt Creator(下稱為“前者”

Java_51_組合_內部類詳解_字串String類_equals==的區別

組合 使用組合,可以獲得更多的靈活性,你甚至可以在執行的時候才決定哪幾個類組合在一起。 使用繼承,他是一種高度耦合,派生類和基類被緊緊的綁在一起,靈活性大大降低,而且,濫用繼承,也會使繼承樹變得又大又複雜,很難理解和維護。 如果是is-a關係,用繼承。【是一個[物件]】 如果是h

QT、VS常見bug及解決辦法十一—— fatal error LNK1201:寫入程式資料庫“***.pdb”時出錯;請檢查是否是磁碟空間不足、路徑無效或許可權不夠

 問題:         fatal error LNK1201:寫入程式資料庫“***.pdb”時出錯;請檢查是否是磁碟空間不足、路徑無效或許可權不夠  最近用opencv2.4.10、vs2010做開發經常遇到這個問題,經百度發現大部分是vs自己的問題 解決辦法1:

SAP_ABAP_GS01/GS02/GS03資料集_引數條件表靈活配置GS01/GS02/GS03

在開發中,某段程式碼執行可能需要滿足某個條件,通常解決辦法有兩種:一種是在程式碼中寫死限制條件,此種方式當限制條件變化時需要修改程式碼;另一種辦法則是自定義資料表,將限制條件值儲存在表中,當程式執行時,可以直接從表中讀取條件值作為控制條件,這樣比較靈活,就像Java開發中的屬

FreeRTOS之全配置項詳解、裁剪FreeRTOSConfig.h

簡介   首先,我們需要明確一個問題,FreeRTOSConfig.h是一個使用者級別的檔案,不屬於核心檔案。每個使用者可以有不同的FreeRTOSConfig.h。   FreeRTOS作為一個可高度配置的實時核心,其絕大多數配置選項都體現在FreeRTO

Qt Quick裡的圖形效果:陰影Drop Shadow

    Qt Quick提供了兩種陰影效果:DropShow,陰影。這個元素會根據源影象,產生一個彩色的、模糊的新影象,把這個新影象放在源影象後面,給人一種源影象從背景上凸出來的效果。InnerShadow,內陰影。這個元素會根據源影象,產生一個彩色的、模糊的新影象,與 Dr

QT tabwidget 程式碼新增標籤頁的方法可以最大化

QT用程式碼對介面進行佈局時,按常規思路在tabwidget遇到一個很大的問題:就是最大化後有問題,沒有實現最大化的效果。 後來通過各種查詢最後又找到一種方法對tabwidget新增頁: //.h檔案 class Data : public QMainWin

V4L2 獲取配置攝像頭程式示例使用v4l2_queryctrl

V4L2 獲取和配置攝像頭程式示例: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <error.h> #include <s

Qt工作筆記-對QImage的進一步認識關於α通道

一般的點陣圖BMP圖,是沒有α通道的,如下圖所示: 而在寫OpenGL的程式時候,往往要得到影象的資料位的資料,不用框架,使用FILE很容易就可以獲取影象的資料, 如下圖: 但用框架將更為方便: 程式碼如下: QImage *image=ne

Qt一步一步實現外掛通訊附原始碼

前一章已經實現了主程式呼叫載入外掛功能,這一章描述主程式和外掛間通訊功能 說道Qt的通訊必須要了解訊號和槽的機制原理,這裡不做論述,不清楚的同學去看看訊號和槽機制 不廢話直接上步驟,在上一章的基礎下進行修改 第一步:在外掛中定義一個接收槽 1 2 3

Qt 4.8.6 X11、embeded x86qvfb執行 、embeded arm各個版本編譯總結

QT是跨平臺C++圖形使用者介面應用程式開發框架,可以實現一套原始碼,多個平臺編譯執行。可視為平臺無關的開發環境。 QT原始碼可以被編譯成很多個版本,這裡介紹3個版本:linux桌面版(X11),embeded x86版,embeded arm版。編譯後生成對應平臺庫檔案,使用某平臺的編譯器編譯應用程式時就

python基礎操作_方法函數

形參 num 變參 可變參數 int 聲明 args 是個 如果 #函數,方法#普通方法def hello(): print(‘hello‘)hello()#帶形參的方法def hello1(name): print(‘hello%s‘%name)hello1(

samba文件共享服務配置(multiuser機制)二 共兩節

掛載點 機制 tool 用戶 vim ins 掛載 samba install smb客戶端的multiuser掛載技術 --管理員只需要作一次掛載 --客戶端在訪問掛載點時,若需要不同權限,可臨時切換新的共享用戶【無需重新掛載】 實現方式 --掛載smb共享時啟用mul

本地配置DNS服務器MAC版

希望 設備 gin host bin 方式 regexp update 服務 作為一個前端開發者,會遇到使用cookie的情況,常見的如:登錄,權限控制,視頻播放,圖形驗證碼等,這時候本地開發者在PC上會使用修改hosts的方式添加指向本地的域名,來獲取cookie的同域名

JQeury添加刪除class內部實現代碼簡化版

就是 while bsp span indexof val 元素 move 添加 下面是JQuery對元素class操作的簡單實現,請看代碼: 添加class: //增加class function addClass(elem,value)