這兩天在研究Q在樹莓派3上的交叉編譯,但是一直不順利,問題基本上都出現在make指令後面,雖然前面的aotuconfig指令是可以通過的,但是還是出問題,看了很多博文,試了很多中不同的config方法,但是還是沒有解決,於是決定自己從頭翻譯一遍configure -help的文檔
開始吧!
./configure -help
Configure understands variable assignments like VAR=value on command line. Each uppercased library name (obtainable with -list-libraries) supports the suffixes _INCLUDE, _LIBDIR, _PREFIX (INCDIR=PREFIX/include, LIBDIR=PREFIX/lib), _LIBS, and - on Windows and Darwin - _LIBS_DEBUG and _LIBS_RELEASE. E.g., ICU_PREFIX=opt/icu42 ICU_LIBS="-licui18n -licuuc -licudata".
爲可識別的變量名指派值就像在命令行中使用 VAR=value 的寫法,每一個大寫的庫名(與-list–libraries所獲得的)支持後綴 _INCLUDE, _LIBDIR, _PREFIX(INCDIR=PREFIX/include, LIBDIR=PREFIX/lib), _LIBS, and - on Windows and Darwin - _LIBS_DEBUG and _LIBS_RELEASE. E.g., ICU_PREFIX=opt/icu42 ICU_LIBS="-licui18n -licuuc -licudata"
It is also possible to manipulate any QMAKE_* variabele, to amend the values from the mkspec for ths build of Qt itself, e.g., QMAKE_CXXFLAGS+=-g3.
也可以操作任何QMAKE_*的變量,從mkspec中獲取值來構建Qt本身,比如QMAKE——CXXFLAGS+=-g3
Note that the * LIBS * and QMAKE* assignments manipulate lists, so items containting meta characters (spaces in particular) need to be quoted according to qmake rules. On top of that, the assignments as a whole need to be quoted according to shell rules. It is recommended to use single quotes for the inner quoting and double quotes for the outer quoting.
需要注意的是* LIBS * 和 QMAKE * 指派了多個列表,所以包含了元數據的項目需要根據qmake的規則來引用,除此之外,作爲一個整體來分配需要根據shell原則來引用,建議對內部引用使用單一引用,外部引用使用雙重引用
Top-level installation directories:
命令 | 說明 |
---|---|
-prefix < dir > | The deployment directory, as seen on the target device. [/usr/local/Qt-$QT_VERSION; qtbase build directory if -developer-build] |
-prefix < dir > | 部署目錄,可以在目標設備上看到 |
-extprefix < dir > | The installation directory, as seen on the host |
安裝目錄 | 可以在主機上看到 |
-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. [EXTPEFIX] |
-hostprefix [dir] | 運行在主機上的構建工具的安裝目錄,日過滅有指定 [dir] 則會使用當前構建的地址 |
-external-hostbindir < path > | Path to Qt tools built for this machine. Use this when -platform does not match ths current system, i.e., to make a Canadian Cross Build |
-external-hostbindir < path > | 爲這臺機器所構建的Qt工具的路徑,當 -platform 和當前的系統不同的時候使用,比如構建Canadian Cross |
微調目錄列表,需要注意的是所有的目錄,除了 -sysconfdir,應該放置在 -prefix/-hostprefix中
命令 | 說明 |
---|---|
-bindir < dir > | Executables [PREFIX/bin] 可執行的 [PREFIX/bin] |
-headerdir < dir > | Header files [PREFIX/include] 頭文件[PREFIX/bin] |
-libdir < dir > | Libraries [PREFIX/lib] 庫[PREFIX/lib] |
-archdatadir < dir > | Arch-dependent data [PREFIX] 主要依賴數據 [PREFIX] |
-plugindir < dir > | Plugins [ARCHDATADIR/plugins] 插件 [ARCHDATADIR/plugins] |
-libexecdir < dir > | Helper programs [ARCHDATADIR/bin on Windows, ARCHDATADIR/libexec otherwise] 幫助程序 |
-importdir < dir > | QML1 import [ARCHDATADIR/imports] QML1導入 |
-libexecdir < dir > | QML2 imports [ARCHDATAIR/qml] QML2導入 |
-datadir < dir > | Arch-independent data [PREFIX] 主要依賴數據 |
-docdir < dir > | Documentation [DATADIR/doc] 文檔 |
-translationdir < dir > | Translations [DATADIR/translation] 傳輸 |
-sysconfdir < dir > | Setting used by Qt programs [PREFIX/etc/xdg] Qt程序所使用的設置 |
-examplesdir < dir > | Examples [PREFIX/tests] 範例 |
-testsdir < dir > | Test [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 specifid; ‘auto’ is a shorthand for ‘yes/no’. Solitaray ‘yes’ and ‘no’ represent binary options without auto-detection
其餘選項的約定:當一個選項後面的值被括號擴住的時候,按照下面的進行解析:“yes”代表空選項;所有的其他的值都可以作爲這個選項的前綴,比如 -no-gu;否則這個值可以被指定,比如:-gui=yes,如果沒有指定的話,值會按照他們嘗試的次序來列出,‘auto’ 是對’yes/no’。單獨的’yes’或者’no’代表不包含自動搜尋的二進制選項
Configure meta
選項 | 說明 |
---|---|
-help, -h | 顯示幫助界面 |
-verbose, -v | 在配置的時候打印複雜的信息 |
-continue | 在出現故障的時候繼續配置 |
-redo | 使用之前使用的選項來重新配置,附加的選項可能被忽略,但是將不會儲存從而被 -redo在後面使用 |
recheck [test, …] | 清除緩存,消極的測試配置結果,在安裝後丟失依賴後使用,否則,如果測試是指定的,只有他們的結果被清除 |
-recheck-all | 清除測試結果的所有配置 |
-feature-< feature > | Enable < feature > |
-no-feature-< feature > | 禁用< feature > [none] |
-list-features | 列舉所有可用的特性,也需要注意的是一些特性有專有的命令行選項 |
-list-libraries | 列出額外的可能的依賴 |
Build options:
選項 | 說明 |
---|---|
-opensource | 構建開源Qt |
-commercial | 構建商業版Qt |
-confirm-license | 自動識別license |
-release | 構建Qt關閉Debug[yes] |
-debug | 構建Qt使能Debug[No] |
-debug-and-release | 構建兩個Qt,一個有debug,一個沒有debug,僅支持在Apple和Windows中 |
-optimize-debug | 使能友好debug選項在debug構建模式中[auto],不支持MSVC和Clang工具鏈 |
-optimize-size | 優化構建的大小而非速度[no] |
-optimized-tools | 充分利用主機的工具來構建即使在debug構建中[no] |
-force-debug-info | 爲release構建創建語法文件[no] |
-separate-debug-info | 將Debug信息分割成文件[no] |
-gdb-index | 索引debug信息來提升GDB[no] |
-strip | 爲不需要的語法去除release binaries |
-gc-binaries | 放置每一個二進制文件到他們自己的章節中,並且使能不適用的章節中的鏈接垃圾收集[在靜態構建中是auto,其他時候是no] |
-force-asserts | 使能Q_ASSERT即使在release構建中[no] |
-developer-build | 編譯和鏈接Qt本身[no] |
-shared | 編譯Qt動態鏈接庫[yes] |
-static | 編譯Qt靜態鏈接庫[no] |
-framework | 構建Qt構建包[yes] |
-platform < target > | 選擇主機的構建 mkspec[deceted] |
-xplatform < target > | 在交叉編譯中選擇目標mkspc[PLATFORM] |
-device < name > | 構建某設備的交叉編譯 |
-device-option < key=value > | 添加設備mkspec的選項 |
-appstore-compliant | 禁用平臺APPStore中不允許的代碼,如果在APPStore中默認是分配的,那麼默認是no,尤其在安卓,ios,tvos,還有未指定的Windows平臺中[auto] |
-qtnamespace < name > | 封裝namespace中所有Qt的庫 |
-qtlibinfix < infix > | 在libQt5*< infix >.so 中重命名所有的libQt5*.so |
-testcocoonn | 使用TestCocoon代碼覆蓋工具進行測試[no] |
-gov | 使用GCov代碼覆蓋工具進行測試[no] |
-trace [backend] | 使能帶追蹤點的設備,當前只支持的終端是windows和linux[no] |
-sanitize {addres/thread/memory/undefind} | 創建制定的編譯器過濾器 |
-c++std < edition > | 選擇C++標準 < edition > [c++1z/c++14/c++11](不支持MSVC) |
-sse2 | 使用SSE2設備[aotu] |
-sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512 | 允許使用特殊的x86設備[auto] |
-mip_dsp/-mips_dspr2 | 使用MIPS DSP/rev2 設備 [auto] |
qreal < type > | 指定qreal到指定的類型[double] |
-R < string > | 添加一個明確的runtime庫路徑到Qt庫中,支持和LIBDIR相關的路徑 |
rpath | 使用庫安裝路徑作爲一個運行庫路徑來鏈接Qt庫和可執行文件,禁用這個意味着使用絕對安裝名稱(基於LIBDIR)用在動態鏈接庫和框架中[auto] |
-reduce-exparts | 減少大量的導出語法[auto] |
-reduce-relocations | 減少大量的重定向[auto] |
-reduce-relocations | 在插件中嵌入 [no] |
-static-runtime | 可 -static一起使用,使用static runtime[no] |
-pch | 使用預編譯頭文件[auto] |
-ltcg | 使用鏈接時刻代碼生成[no] |
-use-gold-linker | 使用GNU gold linker[auto] |
-incredibuild-xge | 使用incredibuild XGE[no](window noly) |
-ccache | 使用ccache編譯器緩存[no] (linux only) |
-make-tool < tool > | 使用< tool >來構建qmake[nmake] (windowsonly) |
-mp | 使用多進程編譯(MSVC only) |
-warning-are-errors | 警告是錯誤[no] |
-silent | 減少構建輸出,這樣錯誤和警告就會出現的更明顯 |
Build environment
選項 | 說明 |
---|---|
-sysroot < dir > | 設置 < dir > 作爲目標sysroot |
-gcc-sysroot | 和 -sysroot一起,讓編譯器忽略 --sysroot[yes] |
-pkg-config | 使用ppkg-config[auto] |
-D < string > | 通過附加的預處理器 |
-I < string > | 通過附加的包含路徑 |
-L < string > | 通過附加的庫路徑 |
-F < string > | 通過附加的框架路徑 |
-sdk < sdk > | 使用Apple提供的SDK來構建Qt |
Component selection
選項 | 說明 |
---|---|
-skip < repo > | 在構建過程中排除整個庫 |
-make < part > | 添加 < part > 到所構建的parts列表中 |
-nomake < part > | 從構建的parts列表中排除< part > |
-compile-examples | 當沒有設置的死後,僅僅安裝例子的源碼[不在 WebAssembly中,否則是yes] |
-gui | 構建gui模塊[yes] |
-widgets | 構建widget模塊[yes] |
-no-dbus | 不構建D-Bus |
-dbus-linked | 構建Qt D-Bus並且鏈接到libdbus-1中 |
-dbus-runtime | 構建Qt D-Bus並且動態鏈接到libdbus-1中 |
-accessibility | 使能可訪問的支持[yes] |
Qt還綁定這一些第三方的庫,他們默認情況下是使用的
Core options:
選項 | 描述 |
---|---|
-doubleconversion | 選擇所使用的double轉換庫[system/qt/no] |
-glib | 使能Glib支持[no, auto on Unix] |
-eventfd | 使能eventfd 支持 |
-inotify | 使能inotify支持 |
-iconv | 使能 iconv支持 |
-icu | 使能ICU支持 |
-pcre | 選擇所使用的libpcre2[system/qt] |
-pps | 使能pps支持 |
-zlib | 選擇所使用的zlib[system/qt] |
Logging backends
選項 | 描述 |
---|---|
-journald | 使能journald支持[no] |
-syslog | 使能syslog支持[no] |
-slog2 | 使能slog2支持[auto] |
Network options:
選項 | 描述 |
---|---|
-ssl | 使能SSL支持[auto] |
-no-openssl | 不使用openssl |
-openssl-linked | 使用OpenSSL並且鏈接到libssl中[no] |
-openssl-runtime | 使用OpenSSL並且動態鏈接libssl[auto] |
-securetransport | 使用祕密傳輸端口[auto] |
-sctp | 使能sctp支持[no] |
-libproxy | 使能libproxy[no] |
-system-proxies | 默認情況下使用系統代理[yes] |
Gui, printing, widget, options: