我正在尝试获取boot2qt构建环境。它适用于iMX53 - 而不是在回答我的问题时它真的很重要......
因此,作为流程的一部分,我运行名为" build_qt.sh"的脚本。这会调用带有大量参数的嵌套配置脚本。反过来,该脚本从源代码构建qmake,然后尝试使用新的qmake来构建qt的其余部分(从它看起来如何?)。
经过长时间的战斗,我得到了它成功创建qmake二进制文件,但随后脚本通过调用传递给configure脚本的所有参数来结束。然后Qmake失败,因为大多数这些参数都不是有效的qmake选项!
这是摘自build_qt.sh:
CONFIGURE_ARGS="${CONFIGURE_ARGS} \
-commercial -confirm-license -release \
-device ${DEVICE} \
-device-option CROSS_COMPILE=${WORKDIR}/tmp/sysroots/x86_64-linux/usr/bin/${COMPILER} \
-sysroot ${WORKDIR}/toolchain/sysroots/${SYSROOT} \
-no-xcb -separate-debug-info -silent -nomake examples -nomake tests -tslib -no-pch -v"
...
./configure ${CONFIGURE_ARGS}
在该配置脚本的末尾,它执行此操作:
"$outpath/bin/qmake" "$relpathMangled" -- "$@"
请注意$@
。那些所有这些配置参数最终会被打破的地方。具体来说,它抱怨它得到的第一个参数不适用于qmake。
这是它尝试执行的实际语句:
/home/osboxes/Qt/Boot2Qt-2.x/imx53qsb-eLinux/build-imx53qsb/bin/qmake /home/osboxes/Qt/Boot2Qt-2.x/imx53qsb-eLinux/build-imx53qsb/qt5-src -- -commercial -confirm-license -release -device linux-imx53qsb-hf-g++ -device-option CROSS_COMPILE=/home/osboxes/Qt/Boot2Qt-2.x/imx53qsb-eLinux/build-imx53qsb/tmp/sysroots/x86_64-linux/usr/bin/armv7ahf-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi- -sysroot /home/osboxes/Qt/Boot2Qt-2.x/imx53qsb-eLinux/build-imx53qsb/toolchain/sysroots/armv7ahf-vfp-neon-poky-linux-gnueabi -no-xcb -separate-debug-info -silent -nomake examples -nomake tests -tslib -no-pch -v
这就是结果:
ERROR: Unknown command line option '-commercial'.
这是实际的qmake二进制帮助输出,它定义了预期的语法:
Usage: ./bin/qmake [mode] [options] [files]
QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project
Mode:
-project Put qmake into project file generation mode
In this mode qmake interprets files as files to
be built,
defaults to *; *; *; *.ts; *.xlf; *.qrc
Note: The created .pro file probably will
need to be edited. For example add the QT variable to
specify what modules are required.
-makefile Put qmake into makefile generation mode (default)
In this mode qmake interprets files as project files to
be processed, if skipped qmake will try to find a project
file in your current working directory
Warnings Options:
-Wnone Turn off all warnings; specific ones may be re-enabled by
later -W options
-Wall Turn on all warnings
-Wparser Turn on parser warnings
-Wlogic Turn on logic warnings (on by default)
-Wdeprecated Turn on deprecation warnings (on by default)
Options:
* You can place any variable assignment in options and it will be *
* processed as if it was in [files]. These assignments will be *
* processed before [files] by default. *
-o file Write output to file
-d Increase debug level
-t templ Overrides TEMPLATE as templ
-tp prefix Overrides TEMPLATE so that prefix is prefixed into the value
-help This help
-v Version information
-early All subsequent variable assignments will be
parsed right before default_pre.prf
-before All subsequent variable assignments will be
parsed right before [files] (the default)
-after All subsequent variable assignments will be
parsed after [files]
-late All subsequent variable assignments will be
parsed right after default_post.prf
-norecursive Don't do a recursive search
-recursive Do a recursive search
-set <prop> <value> Set persistent property
-unset <prop> Unset persistent property
-query <prop> Query persistent property. Show all if <prop> is empty.
-qtconf file Use file instead of looking for qt.conf
-cache file Use file as cache [makefile mode only]
-spec spec Use spec as QMAKESPEC [makefile mode only]
-nocache Don't use a cache file [makefile mode only]
-nodepend Don't generate dependencies [makefile mode only]
-nomoc Don't generate moc targets [makefile mode only]
-nopwd Don't look for files in pwd [project mode only]
请注意,父build_qt.sh
脚本在此之后运行Make。此外,qmake&#34;默认模式&#34;是-makefile
Put qmake into makefile generation mode (default)
。所以,我非常肯定这个未能执行的命令应该是写一个makefile(实际上这是一个&#34; configure脚本&#34;在另一个内部)。
有谁知道这个命令应该在这里?
有人可以为我运行类似的build_qt.sh
实例,并通过其功能脚本发布在这里运行的命令吗?这对于解决这个问题可能会有很长的路要走。
答案 0 :(得分:0)
结果显示父build_qt.sh
脚本,configure
脚本来自不同版本的Qt。它们不兼容!较旧版本的Qt没有这个麻烦的界限:
"$outpath/bin/qmake" "$relpathMangled" -- "$@"
相反,他们看起来像这样:
"$outpath/bin/qmake" "$relpathMangled"
这更有意义!我不知道为什么当前的配置文件中有这种功能,但对我来说无关紧要。