Skip to content

Conversation

@lemzwerg
Copy link
Contributor

@lemzwerg lemzwerg commented Sep 3, 2017

This is the same as #11101 but moved to a separate branch.

Use '<QtCore/qconfig.h> and '<QtCore/qglobal.h>' for testing QT_VERSION.
This makes the tests work with both Qt4 and Qt5, even if '-fPIC' or '-fPIE'
is not used (the compiler might choke otherwise if QT_REDUCE_RELOCATIONS is
active).
Add double qoutes to string tests where arguments could (theoretically)
contain spaces.

Remove double quotes where not necessary.
Consequently quote all arguments of M4 functions.

Mark empty M4 arguments with '[]'.
@fanquake
Copy link
Member

fanquake commented Sep 3, 2017

Please update the PR title to something more explanatory, as they are now included in merge commits.

@lemzwerg lemzwerg changed the title Config fixes bitcoin_qt.m4: Minor fixes and clean-ups. Sep 3, 2017
@lemzwerg
Copy link
Contributor Author

lemzwerg commented Sep 3, 2017

Better now?

@practicalswift
Copy link
Contributor

utACK 40c8a65

@laanwj
Copy link
Member

laanwj commented Oct 2, 2017

@theuni Can you take a look at the build system changes here please?

[bitcoin_cv_static_qt=no])
])
if test xbitcoin_cv_static_qt = xyes; then
if test x$bitcoin_cv_static_qt = xyes; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was clearly broken before, but it didn't matter because we define QT_STATICPLUGIN elsewhere. Let's just delete this.

@theuni
Copy link
Member

theuni commented Oct 2, 2017

I wasn't comfortable reviewing e90d91c accurately, so I scripted it. Could you please update the commit message to make it a scripted diff? See here for an explanation: https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#scripted-diffs

The script I used, which matches your commit, is:

sed -iE -e 's/"x\(yes\|no\|auto\)\?"/x\1/g' -e 's/test \(x\$[^ ]*\)/test "\1"/g' build-aux/m4/bitcoin_qt.m4

@theuni
Copy link
Member

theuni commented Oct 2, 2017

Did you use some tool or script for the m4 macros? I think it's fine, but I'm nervous about some issue turning up months from now because of an errant bracket.

@lemzwerg
Copy link
Contributor Author

lemzwerg commented Oct 3, 2017

No time for creating a script, sorry. I suggest that you do a comparison with

git diff --word-diff-regex=. --word-diff=color e90d91c^ e90d91c

for review; this shows the changes of this commit in the most compact form.

Just a final note regarding bitcoin's M4 stuff for configuring Qt: I now believe that this is the wrong way. Without the help of qmake it will always remain a guesswork what compiler flags should be really used, and what code should be used for static linking. Have a look at

http://repo.or.cz/ttfautohint.git/blob_plain/HEAD:/m4/autotroll.m4
http://repo.or.cz/ttfautohint.git/blob/HEAD:/configure.ac#l52
http://repo.or.cz/ttfautohint.git/blob/HEAD:/frontend/static-plugins.cpp.in

for my current solution. For example, if I configure ttfautohint for cross-building with mxe, static-plugins.cpp automatically contains the following code.

// This file is autogenerated by qmake. It imports static plugin classes for
// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
#include <QtPlugin>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)

@lemzwerg
Copy link
Contributor Author

FYI: autotroll has been updated with my changes and is now available from https://github.com/tsuna/autotroll.

@theuni
Copy link
Member

theuni commented Oct 16, 2017

@lemzwerg I'd really rather not change all this around arbitrarily. And I'd certainly not require qmake. Especially considering that they'll be replacing it with qbs in the future.

Everything but the last commit looks good to me (after addressing #11222 (comment)). I assume the last is probably ok too, but I'd rather not risk introducing some obscure new error if this doesn't fix a reported bug.

@laanwj
Copy link
Member

laanwj commented Nov 17, 2017

Needs update for @cfields' comments.

@fanquake
Copy link
Member

Closing in favour of #11711.

@fanquake fanquake closed this Nov 17, 2017
laanwj added a commit that referenced this pull request Jan 29, 2018
06abcbf scripted-diff: Orthogonalize string quoting (Werner Lemberg)
e0496d3 bitcoin_qt.m4: Add missing dollar sign for variable. (Werner Lemberg)
079f4b2 bitcoin_qt.m4: Add missing braces around variables in autoconf messages. (Werner Lemberg)
8695315 bitcoin_qt.m4: Use correct M4 quoting characters. (Werner Lemberg)
db32a4f bitcoin_qt.m4: Improve QT_VERSION tests. (Werner Lemberg)

Pull request description:

  Replaces #11222.

  Dropped the last commit, and converted e90d91c (now 06abcbf) into a scripted-diff using @theuni's suggestion.

Tree-SHA512: f2e1713bda96e8875be08839af914b24b3240f2eecf18cb268f83c82d965ebf544a0022af4f6f73b88b637a4fdd404a96b9fcf8e5bdd11c507b5bb425eeb7e1d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 31, 2020
06abcbf scripted-diff: Orthogonalize string quoting (Werner Lemberg)
e0496d3 bitcoin_qt.m4: Add missing dollar sign for variable. (Werner Lemberg)
079f4b2 bitcoin_qt.m4: Add missing braces around variables in autoconf messages. (Werner Lemberg)
8695315 bitcoin_qt.m4: Use correct M4 quoting characters. (Werner Lemberg)
db32a4f bitcoin_qt.m4: Improve QT_VERSION tests. (Werner Lemberg)

Pull request description:

  Replaces bitcoin#11222.

  Dropped the last commit, and converted e90d91c (now 06abcbf) into a scripted-diff using @theuni's suggestion.

Tree-SHA512: f2e1713bda96e8875be08839af914b24b3240f2eecf18cb268f83c82d965ebf544a0022af4f6f73b88b637a4fdd404a96b9fcf8e5bdd11c507b5bb425eeb7e1d
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants