From: Thiago Macieira <thiago.macieira@intel.com>
To: Michal Marek <mmarek@suse.com>
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: make xconfig no longer works in Fedora
Date: Mon, 02 Nov 2015 08:46:55 -0500 [thread overview]
Message-ID: <2978371.kMj1QX9251@tjmaciei-mobl4> (raw)
In-Reply-To: <56373CBB.3010801@suse.com>
[-- Attachment #1: Type: text/plain, Size: 789 bytes --]
On Monday 02 November 2015 11:36:43 Michal Marek wrote:
> On 2015-11-02 04:20, Thiago Macieira wrote:
> > - qtver=`qmake -query QT_VERSION` || { \
> > + qtver=`qmake -query QT_VERSION` || \
> > + qtver=`qmake-qt5 -query QT_VERSION` || \
> > + qtver=`qmake-qt4 -query QT_VERSION` || { \
>
> The qtlibdir= etc assignments below still use qmake directly, plus this
> will print an error if the command is not called "qmake." As Alexey
> says, we do not need qmake, we need moc and the cflags / ldflags. Since
> pkg-config worked for us previously, I suggest to use pkg-config again
> and just check which of QtGui or Qt5Widgets is available.
Here's an attempt using pkg-config.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
[-- Attachment #2: 0001-Use-pkg-config-to-find-Qt-4-and-5-instead-of-direct-.patch --]
[-- Type: text/x-patch, Size: 2725 bytes --]
>From b36464e33f102530abe98e0b5e25dee584f50b59 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Sun, 1 Nov 2015 21:12:53 -0600
Subject: [PATCH 1/1] Use pkg-config to find Qt 4 and 5 instead of direct qmake
The Qt Project recommendation is that there should always be a "qmake"
binary and it should never be renamed. If it's necessary to handle
multiple Qt versions, the Qt Project recommends using qtchooser.
Unfortunately, some distros do not follow the recommendation, so we
would need to check qmake-qt4, qmake-qt5, etc. So, instead, let's try
pkg-config.
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
---
scripts/kconfig/Makefile | 37 +++++++++++++------------------------
1 file changed, 13 insertions(+), 24 deletions(-)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 33c4994..8d0b1ba 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -227,35 +227,24 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile
# Qt needs some extra effort...
$(obj)/.tmp_qtcheck:
@set -e; $(kecho) " CHECK qt"; \
- qtver=`qmake -query QT_VERSION` || { \
+ if pkg-config --exists Qt5Core; then \
+ cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \
+ libs=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \
+ moc=`pkg-config --variable=host_bins Qt5Core`/moc; \
+ elif pkg-config --exists QtCore; then \
+ cflags=`pkg-config --cflags QtCore QtGui`; \
+ libs=`pkg-config --libs QtCore QtGui`; \
+ moc=`pkg-config --variable=moc_location QtCore`; \
+ else \
echo >&2 "*"; \
- echo >&2 "* qmake failed."; \
+ echo >&2 "* Could not find Qt via pkg-config."; \
+ echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \
echo >&2 "*"; \
exit 1; \
- }; \
- qtlibdir=`qmake -query QT_INSTALL_LIBS`; \
- qthdrdir=`qmake -query QT_INSTALL_HEADERS`; \
- qtbindir=`qmake -query QT_INSTALL_BINS`; \
- cflags="-I$$qthdrdir -I$$qthdrdir/QtCore -I$$qthdrdir/QtGui"; \
- case "$$qtver" in \
- 5.*) \
- cflags="$$cflags -I$$qthdrdir/QtWidgets -std=c++11 -fPIC"; \
- libs="-L$$qtlibdir -lQt5Widgets -lQt5Gui -lQt5Core "; \
- ;; \
- 4.*) \
- libs="-L$$qtlibdir -lQtGui -lQtCore"; \
- ;; \
- *) \
- echo >&2 "*"; \
- echo >&2 "* Found qmake but it is for Qt version $$qtver, which is not supported."; \
- echo >&2 "* Please install either Qt 4.8 or 5.x."; \
- echo >&2 "*"; \
- exit 1; \
- ;; \
- esac; \
+ fi; \
echo "KC_QT_CFLAGS=$$cflags" > $@; \
echo "KC_QT_LIBS=$$libs" >> $@; \
- echo "KC_QT_MOC=$$qtbindir/moc" >> $@
+ echo "KC_QT_MOC=$$moc" >> $@
endif
$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
--
2.6.2
next prev parent reply other threads:[~2015-11-02 13:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-31 12:39 Alexey Brodkin
2015-11-02 3:20 ` Thiago Macieira
2015-11-02 10:36 ` Michal Marek
2015-11-02 13:46 ` Thiago Macieira [this message]
2015-11-02 15:50 ` Michal Marek
2015-11-02 16:01 ` Thiago Macieira
2015-11-02 16:07 ` Michal Marek
2015-11-02 16:28 ` Alexey Brodkin
2015-11-02 20:38 ` Michal Marek
2015-11-02 20:43 ` Alexey Brodkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2978371.kMj1QX9251@tjmaciei-mobl4 \
--to=thiago.macieira@intel.com \
--cc=Alexey.Brodkin@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®