1. 程式人生 > >【Qt】Qt5.8交叉編譯配置選項詳解(./configure --help)

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

Usage:  configure [options] [assignments]


Configure understands variable assignments like VAR=value on the command line.
These override any values possibly obtained from pkg-config. The variables
are mentioned in the descriptions of the options they relate to.


It is also possible to manipulate any QMAKE_* variable, to amend the values
from the mkspec for the build of Qt itself, e.g., QMAKE_CXXFLAGS+=-g3.
在命令列配置變數,如var=值。這將覆蓋從pkg-config獲得的變數值
也可以在mkspec中通過操作qmake_*變數來構建Qt應用程式,例如,qmake_cxxflags += - G3。


頂級安裝目錄:
Top-level installation directories:
  -prefix <dir> ...... The deployment directory, as seen on the target device.
                       [/usr/local/Qt-$QT_VERSION, $PWD if -developer-build]
部署目錄,在目標裝置上看到的。
  -extprefix <dir> ... The installation directory, as seen on the host machine.
                       [SYSROOT/PREFIX]
安裝目錄,在主機上看到的
  -hostprefix [dir] .. The installation directory for build tools running on
                       the host machine. If [dir] is not given, the current
                       build directory will be used. [EXTPREFIX]
安裝目錄:在主機上正在編譯的生成工具的安裝目錄。如果未給出,則為當前目錄
  -external-hostbindir <path> ... Path to Qt tools built for this machine.
                       Use this when -platform does not match the current
                       system, i.e., to make a Canadian Cross Build.
為該機器構建的Qt工具路徑,當-platform與當前系統不匹配時使用此選項,如交叉編譯???
Fine tuning of installation directory layout. Note that all directories
except -sysconfdir should be located under -prefix/-hostprefix:
安裝目錄佈局的微調。請注意,所有目錄除sysconfdir應位於在-prefix/-hostprefix指定的目錄下面:
  -bindir <dir> ......... Executables [PREFIX/bin]可執行檔案路徑
  -headerdir <dir> ...... Header files [PREFIX/include]標頭檔案路徑
  -libdir <dir> ......... Libraries [PREFIX/lib]庫檔案路徑
  -archdatadir <dir> .... Arch-dependent data [PREFIX]依賴平臺數據
  -plugindir <dir> ...... Plugins [ARCHDATADIR/plugins]外掛路徑
  -libexecdir <dir> ..... Helper programs [ARCHDATADIR/bin on Windows,
                          ARCHDATADIR/libexec otherwise]
輔助程式(外部呼叫程式???)
  -importdir <dir> ...... QML1 imports [ARCHDATADIR/imports]QML1入口
  -qmldir <dir> ......... QML2 imports [ARCHDATADIR/qml]QML2入口
  -datadir <dir> ........ Arch-independent data [PREFIX]獨立的平臺數據
  -docdir <dir> ......... Documentation [DATADIR/doc]文件
  -translationdir <dir> . Translations [DATADIR/translations]翻譯
  -sysconfdir <dir> ..... Settings used by Qt programs [PREFIX/etc/xdg]Qt程式配置目錄
  -examplesdir <dir> .... Examples [PREFIX/examples]例子目錄
  -testsdir <dir> ....... Tests [PREFIX/tests]測試目錄


  -hostbindir <dir> ..... Host executables [HOSTPREFIX/bin]主機可執行程式目錄
  -hostlibdir <dir> ..... Host libraries [HOSTPREFIX/lib]主機庫目錄
  -hostdatadir <dir> .... Data used by qmake [HOSTPREFIX]qmake使用的資料目錄


Conventions for the remaining options: When an option's description is
followed by a list of values in brackets, the interpretation is as follows:
'yes' represents the bare option; all other values are possible prefixes to
the option, e.g., -no-gui. Alternatively, the value can be assigned, e.g.,
--gui=yes. Values are listed in the order they are tried if not specified;
'auto' is a shorthand for 'yes/no'. Solitary 'yes' and 'no' represent binary
options without auto-detection.
選項的約定:括號中的值,解釋如下:
(以"-libpng... Select used libpng [system/qt/no]"為例)
1)"yes"不用明確指出(-libpng),括號中其他的值可以作為字首,如"-qt-libpng";
2)也可以用--libpng=qt的格式來表示
3)"auto"是"yes"和"no"的簡寫,代表[yes/no]
4)只出現"yes"或"no",說明該選項不能自動檢查,裁剪時要特別留意


Configure meta:
元配置
  -help, -h ............ Display this help screen顯示幫助
  -verbose, -v ......... Print verbose messages during configuration列印詳細配置資訊
  -continue ............ Continue configure despite errors儘管有錯,但繼續配置
  -redo ................ Re-configure with previously used options.
                         Additional options may be passed, but will not be
                         saved for later use by -redo.
使用以前的選項重新配置,可以新增附加選項,但不會保持
  -recheck ............. Discard cached negative configure test results.
                         Use this after installing missing dependencies.
測試配置結果;當安裝依賴缺失是,使用該選項
  -recheck-all ......... Discard all cached configure test results.
測試配置結果


Build options:
編譯選項:
  -opensource .......... Build the Open-Source Edition of Qt:建立開源版本的Qt
  -commercial .......... Build the Commercial Edition of Qt:建立商業版本的Qt
  -confirm-license ..... Automatically acknowledge the license
自動確認許可


  -release ............. Build Qt with debugging turned off [yes]
發行版本
  -debug ............... Build Qt with debugging turned on [no]
除錯版本
  -debug-and-release ... Build two versions of Qt, with and without
                         debugging turned on [yes] (Apple and Windows only)
建立發行和編譯版本(只有蘋果和windows系統支援)
  -optimized-tools ..... Build optimized host tools even in debug build [no]
即使在除錯版本中也進行優化
  -force-debug-info .... Create symbol files for release builds [no]
為發行版本建立符號檔案
  -separate-debug-info . Split off debug information to separate files [no]
將除錯資訊分離到檔案中
  -strip ............... Strip release binaries of unneeded symbols [yes]
發行版:將不必要的符號表剔除,
  -force-asserts ....... Enable Q_ASSERT even in release builds [no]
即使在發行版本中也使能斷言
  -developer-build ..... Compile and link Qt for developing Qt itself
                         (exports for auto-tests, extra checks, etc.) [no]
編譯和連結qt本身
  -shared .............. Build shared Qt libraries [yes] (no for UIKit)
建立共享庫
  -static .............. Build static Qt libraries [no] (yes for UIKit)
建立靜態庫
  -framework ........... Build Qt framework bundles [yes] (Apple only)
構建Qt框架捆綁(只在蘋果系統中)
  -platform <target> ... Select host mkspec [detected]
選擇主機中mkspec目錄下的相應配置
  -host-option <key=value> ..... Add option for the host mkspec
新增主機mkspec選項
  -xplatform <target> .. Select target mkspec when cross-compiling [PLATFORM]
交叉編譯時選目標板的mkspec
  -device <name> ....... Cross-compile for device <name>
制定裝置的交叉編譯
  -device-option <key=value> ... Add option for the device mkspec
新增裝置的mkspec選項
  -qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
在“名稱空間<名稱> {…}”中封裝所有Qt庫程式碼。
  -qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so.
重新命名所有libqt5 *,格式如libQt5*<infix>.so。
  -testcocoon .......... Instrument with the TestCocoon code coverage tool [no]
testcocoon程式碼覆蓋工具
  -gcov ................ Instrument with the GCov code coverage tool [no]
GCov程式碼覆蓋工具
  -sanitize {address|thread|memory|undefined}
                         Instrument with the specified compiler sanitizer.
使用特定的編譯器檢查(地址|執行緒|暫存器|未定義)錯誤
  -c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
                         (Not supported with MSVC)
選擇++C標準版本
  -rtti ................ Build with Runtime Type Information [yes] (MSVC only)
建立執行時型別資訊
  -sse2 ................ Use SSE2 instructions [auto]
使用SSE2指令
  -sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
                         Enable use of particular x86 instructions [auto]
啟用特定x86指令的使用
                         Enabled ones are still subject to runtime detection.
啟用的仍然受到執行時檢測
  -mips_dsp/-mips_dspr2  Use MIPS DSP/rev2 instructions [auto]
使用MIPS DSP 指令
  -qreal <type> ........ typedef qreal to the specified type. [double]
                         Note: this affects binary compatibility.
qreal定義為指定的型別;注意:這會影響二進位制相容性。
  -R <string> .......... Add an explicit runtime library path to the Qt
                         libraries. Supports paths relative to LIBDIR.
向顯式新增Qt庫執行庫路徑。支援相對路徑
  -rpath ............... Link Qt libraries and executables using the library
                         install path as a runtime library path. Similar to
                         -R LIBDIR. On Apple platforms, disabling this implies
                         using absolute install names (based in LIBDIR) for
                         dynamic libraries and frameworks. [auto]
連結Qt庫和可執行檔案時,使用庫安裝路徑作為一個執行庫路徑。類似於-R libdir。在蘋果的平臺上,這意味著使用絕對禁用安裝名稱(總部設在LIBDIR)的動態庫和框架。
  -reduce-exports ...... Reduce amount of exported symbols [auto]
減少輸出符號的數量
  -reduce-relocations .. Reduce amount of relocations [auto] (Unix only)
減少重定位的數量
  -plugin-manifests .... Embed manifests into plugins [no] (Windows only)
嵌入的外掛
  -static-runtime ...... With -static, use static runtime [no] (Windows only)
與-static一同使用,在靜態執行時
  -pch ................. Use precompiled headers [auto]
使用預編譯標頭檔案
  -ltcg ................ Use Link Time Code Generation [no]
使用連結時間程式碼生成
  -use-gold-linker ..... Use the GNU gold linker [auto]
使用GUN全域性連結器
  -incredibuild-xge .... Use the IncrediBuild XGE [no] (Windows only)
  -make-tool <tool> .... Use <tool> to build qmake [nmake] (Windows only)
使用tool去建立qmake
  -mp .................. Use multiple processors for compilation (MSVC only)
使用多個處理器去編譯
  -warnings-are-errors . Treat warnings as errors [no; yes if -developer-build]
將警告視為錯誤
  -silent .............. Reduce the build output so that warnings and errors
                         can be seen more easily
減少編譯輸出,使警告和錯誤更容易看到
Build environment:
構建環境
  -sysroot <dir> ....... Set <dir> as the target sysroot
設定為目標的sysroot目錄(系統root目錄)
  -gcc-sysroot ......... With -sysroot, pass --sysroot to the compiler [yes]
與-sysroot一起使用,將--sysroot傳給編譯器
  -pkg-config .......... Use pkg-config [auto] (Unix only)


  -D <string> .......... Pass additional preprocessor define
新增預定義
  -I <string> .......... Pass additional include path
新增標頭檔案路徑
  -L <string> .......... Pass additional library path
新增庫路徑
  -F <string> .......... Pass additional framework path (Apple only)
新增框架路徑(只在蘋果系統上)
  -sdk <sdk> ........... Build Qt using Apple provided SDK <sdk>. The argument
                         should be one of the available SDKs as listed by
                         'xcodebuild -showsdks'.
                         Note that the argument applies only to Qt libraries
                         and applications built using the target mkspec - not
                         host tools such as qmake, moc, rcc, etc.
利用蘋果建立Qt提供SDK < SDK >。應該是在"xcodebuild - showsdks"上一個可用的SDK。
注意該引數僅適用於使用目標mkspec不是主機工具如qmake,moc,使用目標板的mkspec建成的Qt庫和應用程式。
  -android-sdk path .... Set Android SDK root path [$ANDROID_SDK_ROOT]
  -android-ndk path .... Set Android NDK root path [$ANDROID_NDK_ROOT]
  -android-ndk-platform  Set Android platform
  -android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
                         [$ANDROID_NDK_HOST]
  -android-arch ........ Set Android architecture (armeabi, armeabi-v7a,
                         arm64-v8a, x86, x86_64, mips, mips64)
  -android-toolchain-version ... Set Android toolchain version
  -android-style-assets  Automatically extract style assets from the device at
                         run time. This option makes the Android style behave
                         correctly, but also makes the Android platform plugin
                         incompatible with the LGPL2.1. [yes]
在執行時自動從裝置中提取樣式資產。此選項會使Android風格的正確的行為,也使得Android平臺的lgpl2.1外掛不相容。


Component selection:
組成選項(裁剪)
  -skip <repo> ......... Exclude an entire repository from the build.
整個庫都不包含(由自己去逐個新增???)。
  -make <part> ......... Add <part> to the list of parts to be built.
                         Specifying this option clears the default list first.
                         [libs and examples, also tools if not cross-building,
                         also tests if -developer-build]
將<part>新增到要建造的部件列表中。首先清除預設列表,再指定此選項。


  -nomake <part> ....... Exclude <part> from the list of parts to be built.
從要構建的部件列表中排除
  -compile-examples .... When unset, install only the sources of examples [yes]
如果沒有設定,將只安裝原始碼中的例子
  -gui ................. Build the Qt GUI module and dependencies [yes]
構建GUI模組和依賴
  -widgets ............. Build the Qt Widgets module and dependencies [yes]
構建widgets模組和依賴
  -no-dbus ............. Do not build the Qt D-Bus module
                         [default on Android and Windows]
不構建D-Bus
  -dbus-linked ......... Build Qt D-Bus and link to libdbus-1 [auto]
構建D-Bus並與libdbus-1連結
  -dbus-runtime ........ Build Qt D-Bus and dynamically load libdbus-1 [no]
                         DBUS_PATH= DBUS_HOST_PATH=
構建D-Bus並動態呼叫libdbus-1庫
  -feature-<feature> ... Enable <feature>. The available features are described
                         in src/corelib/global/qfeatures.txt. [all enabled]
啟用<功能>。可用的功能在src/corelib/global/qfeatures.txt中描述
  -accessibility ....... Enable accessibility support [yes]
                         Note: Disabling accessibility is not recommended.
啟用可訪問性支援;注意:禁用可訪問性不推薦
  -qml-debug ........... Enable QML debugging support [yes]
啟動QML除錯支援
Qt comes with bundled copies of some 3rd party libraries. These are used
by default if auto-detection of the respective system library fails.
Qt附帶捆綁一些第三方庫的副本。如果沒有在系統庫中檢測到,將去這些庫中查詢。


Core options:
核心選項:
  -doubleconversion .... Select used double conversion library [system/qt/no]
                         No implies use of sscanf_l and snprintf_l (imprecise).
雙轉換的…選擇使用雙轉換庫.不意味著使用sscanf_l和snprintf_l???
  -glib ................ Enable Glib support [no; auto on Unix]
使能Glib
  -eventfd ............. Enable eventfd support
使能eventfd;(eventfd:linux系統呼叫,為事件通知建立檔案描述符。)
  -inotify ............. Enable inotify support
使能inotify;監控檔案系統操作
  -iconv ............... Enable iconv(3) support [posix/sun/gnu/no] (Unix only)
使能iconv:字元編碼轉換,國際編碼格式間進行文字內碼轉換 
  -icu ................. Enable ICU support [auto]
使能ICU:用於支援軟體國際化的開源專案,根據各地的風俗和語言習慣,實現對數字、貨幣、時間、日期、和訊息的格式化、解析,對字串進行大小寫轉換、整理、搜尋和排序等功能
  -pps ................. Enable PPS support [auto] (QNX only)
使能PPS:QNX的持久的釋出/訂閱(PPS)服務
  -pcre ................ Select used libpcre3 [system/qt]
使能pcre;PCRE(Perl Compatible Regular Expressions中文含義:perl語言相容正則表示式)C語言編寫的正則表示式函式庫
  -zlib ................ Select used zlib [system/qt]
使能zlib
                         ZLIB_LIBS=


  Logging backends:
  後端日誌
    -journald .......... Enable journald support [no] (Unix only)
使能Journald;Journald是為Linux伺服器打造的新系統日誌方式,它標誌著文字日誌檔案的終結。現在日誌資訊寫入到二進位制檔案,使用journalctl閱讀來獲得這些資訊.
    -syslog ............ Enable syslog support [no] (Unix only)
使能syslog
    -slog2 ............. Enable slog2 support [auto] (QNX only)
使能slog2;slog2一個高效能的c/c++多執行緒安全日誌庫
Network options:
網路選項:


  -ssl ................. Enable either SSL support method [auto]
使能SSL
  -no-openssl .......... Do not use OpenSSL [default on Apple and WinRT]
不使用OpenSSL
  -openssl-linked ...... Use OpenSSL and link to libssl [no]
使用OpenSSL,並且連結libssl庫,靜態使用
  -openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]
                         OPENSSL_PATH= OPENSSL_LIBS=, and on Windows also
                         OPENSSL_LIBS_DEBUG= OPENSSL_LIBS_RELEASE=
使用OpenSSL,並且動態載入libssl庫
  -securetransport ..... Use SecureTransport [auto] (Apple only)
使用安全傳輸(只在蘋果系統中)
  -sctp ................ Enable SCTP support [no]
使能SCTP;SCTP流量控制傳輸協議,一個傳輸層協議,是提供基於不可靠傳輸業務的協議之上的可靠的資料報傳輸協議
  -libproxy ............ Enable use of libproxy [no]
使能代理伺服器庫???
  -system-proxies ...... Use system network proxies by default [yes]
預設使用系統網路代理


Gui, printing, widget options:
GUI,列印,widget選項:


  -cups ................ Enable CUPS support [auto] (Unix only)
使能CUPS:CUPS(Common UNIX Printing System,通用Unix列印系統)
  -fontconfig .......... Enable Fontconfig support [auto] (Unix only)
使能字型管理庫
  -freetype ............ Select used FreeType [system/qt/no]
選擇freetype;FreeType庫是高質量的且可移植的字型引擎,它提供統一的介面來訪問多種字型格式檔案
  -harfbuzz ............ Select used HarfBuzz-NG [system/qt/no]
                         (Not auto-detected on Apple and Windows)
選擇使用HarfBuzz-NG;HarfBuzz-NG:可以用來文字渲染等
  -gtk ................. Enable GTK platform theme support [auto]
使能GTK:GTK+(GIMP Toolkit)是一套原始碼以LGPL許可協議分發、跨平臺的圖形工具包。
  -lgmon ............... Enable lgmon support [auto] (QNX only)
QUNIX(Quick UNIX)的系統:QNX是一種商用的遵從POSIX規範的類Unix實時作業系統最成功的微核心作業系統之一


  -no-opengl ........... Disable OpenGL support
禁用OpenGL:開放圖形庫,提供2D/3D 圖形 API
  -opengl <api> ........ Enable OpenGL support. Supported APIs:
                         es2 (default on Windows), desktop (default on Unix),
                         dynamic (Windows only)
使能OpenGL
  -opengles3 ........... Enable OpenGL ES 3.x support instead of ES 2.x [auto]
OpenGL ES (OpenGL for Embedded Systems) 是 OpenGL 三維圖形 API 的子集,針對手機、PDA和遊戲主機等嵌入式裝置而設計。


  -angle ............... Use bundled ANGLE to support OpenGL ES 2.0 [auto]
                         (Windows only)
ANGLE原生圖形層引擎;OpenGL ES 2.0 API中的Web GL(3D繪圖標準)子集介面
  -qpa <name> .......... Select default QPA backend (e.g., xcb, cocoa, windows)
Qt5.0開始,Qt自身不再單獨實現視窗系統,QWS不復存在,取而代之的新機制是QPA(Qt平臺抽象)
  -xcb-xlib............. Enable Xcb-Xlib support [auto]
Xlib:一個用c語言編寫的 X Window System 協議的客戶端庫
  Platform backends:
  平臺的後臺
    -direct2d .......... Enable Direct2D support [auto] (Windows only)
Direct2D 是一種硬體加速的即時模式二維圖形 API,可為二維幾何物件、點陣圖和文字提供高效能、高質量的呈現。
    -directfb .......... Enable DirectFB support [no] (Unix only)
DirectFB的目的是提供硬體圖形加速,目標是提供高階圖形運算包括多層alpha,具有矩形三角形填充/繪製的特性。
    -eglfs ............. Enable EGLFS support [auto; no on Android and Windows]
eglfs是Qt的一個平臺外掛,使Qt程式可以利用opengl es畫圖而無需視窗系統. 這種方式是在支援gpu的嵌入式裝置主要採用的方式. 一般需要gpu廠商提供egl和gles驅動模組.
Qt可以利用eglfs外掛實現直接畫圖(全屏),或者在有視窗管理系統(如wayland合成器weston或Qtwayland合成器)時,通過視窗畫圖.前者只能全屏顯示一個程式,後者可以實現多程序應用
    -gbm ............... Enable backends for GBM [auto] (Linux only)
    -kms ............... Enable backends for KMS [auto] (Linux only)
KMS 就是核心模式設定???終端和X 圖形介面使用相同的解析度
    -linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
qt庫如果是使用-linuxFB選項編譯出的,他在啟動時會讀取環境變數QWS_DISPLAY,用這個來指定qws輸出到那個fb上去
    -mirclient ......... Enable Mir client support [no] (Linux only)
Mir下一代統一的顯示伺服器,取代xorg(xorg是X11的一個實現)
    -xcb ............... Select used xcb-* libraries [system/qt/no]
                         (-qt-xcb still uses system version of libxcb itself)
xcb(X protocol C-language BindingX協議的C語言結合)
  Input backends:
  輸入的後臺
    -evdev ............. Enable evdev support [auto]
使能evdev:輸入事件驅動
    -imf ............... Enable IMF support [auto] (QNX only)
    -libinput .......... Enable libinput support [auto]
輸入子裝置庫
    -mtdev ............. Enable mtdev support [auto]
使能多點觸控
    -tslib ............. Enable tslib support [auto]
使能觸控式螢幕
    -xinput2 ........... Enable XInput2 support [auto]
使能手柄輸入
    -xkbcommon-x11 ..... Select xkbcommon used in combination with xcb
                         [system/qt/no]
xkbcommon是庫來處理鍵盤的描述,包括從磁碟載入,解析和處理他們的狀態
    -xkb-config-root <dir> ... With -qt-xkbcommon-x11, set default XKB config
                               root <dir> [detect]
    -xkbcommon-evdev ... Enable X-less xkbcommon in combination with libinput
                         [auto]


  Image formats:
  圖片格式
    -gif ............... Enable reading support for GIF [auto]
    -ico ............... Enable support for ICO [yes]圖示檔案格式
    -libpng ............ Select used libpng [system/qt/no]
    -libjpeg ........... Select used libjpeg [system/qt/no]


Database options:
資料庫支援
  -sql-<driver> ........ Enable SQL <driver> plugin. Supported drivers:
                         db2 ibase mysql oci odbc psql sqlite2 sqlite tds
                         [all auto]
                         MYSQL_PATH= PSQL_LIBS= SYBASE= SYBASE_LIBS=
  -sqlite .............. Select used sqlite3 [system/qt]