这两天在研究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: