gpt4 book ai didi

qt - 从源代码构建 Qt,qmake 是由其脚本使用无效参数调用的吗?

转载 作者:行者123 更新时间:2023-12-04 13:10:38 24 4
gpt4 key购买 nike

我正在尝试设置 boot2qt 构建环境。它是针对 iMX53 的——并不是说在回答我的问题时它真的很重要......

因此,作为该过程的一部分,我运行了名为“build_qt.sh”的脚本。这会调用带有大量参数的嵌套配置脚本。反过来,该脚本从源代码构建 qmake,然后尝试使用新的 qmake 构建 qt 的其余部分(从它看起来像什么?)。

经过长时间的战斗,我成功地创建了 qmake 二进制文件,但是脚本结束时调用它并将所有参数传递给配置脚本。 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“默认模式”是 -makefile这将 Put qmake into makefile generation mode (default) .所以,我很确定这个无法执行的命令应该是在写一个 makefile(本质上这是另一个里面的“配置脚本”)。

有谁知道这个命令应该在这里是什么?

有人可以运行类似的 build_qt.sh 实例吗?对我来说,并发布他们的功能脚本在这里运行什么命令?这可能对解决这个问题大有帮助。

最佳答案

原来是父 build_qt.sh脚本和 configure脚本来自不同版本的 Qt。他们不兼容!旧版本的 Qt 没有这个麻烦的行:

"$outpath/bin/qmake" "$relpathMangled" -- "$@"

相反,它们看起来像这样:
"$outpath/bin/qmake" "$relpathMangled"

这更有意义!我不知道为什么当前的配置文件中有这种时髦,但目前对我来说并不重要。

关于qt - 从源代码构建 Qt,qmake 是由其脚本使用无效参数调用的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45850797/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com