Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

make xconfig no longer works in Fedora

68 views
Skip to first unread message

Alexey Brodkin

unread,
Oct 31, 2015, 8:40:08 AM10/31/15
to
Hi Thiago,

I noticed that with your patch "Update the buildsystem for KConfig finding Qt"
I cannot use "make xconfig" in Fedora 22 any longer.

That's what I'm seeing:
-------------------->8---------------------
$ make xconfig
CHECK qt
/bin/sh: line 1: qmake: command not found
*
* qmake failed.
*
make[1]: *** No rule to make target 'scripts/kconfig/.tmp_qtcheck', needed by 'scripts/kconfig/qconf.o'. Stop.
Makefile:547: recipe for target 'xconfig' failed
make: *** [xconfig] Error 2
-------------------->8---------------------

The reason why xconfig target fails is in Fedora (at least its recent versions)
there's no "qmake". Instead there're "qmake-qt4" and/or "qmake-qt5" depending on
which Qt packages are installed.

I understand that there're plenty of possible workarounds like creating
an alias qmake -> qmake-qtX, usage of "update-alternatives" etc.

But IMHO it would be really nice if we don't break things that used to work.

Still if I revert the patch in question "make xconfig" works again.
And that's because we did autodiscovery of moc like that:
-------------------->8---------------------
moc="\$$(shell pkg-config QtCore --variable=moc_location)";
-------------------->8---------------------

In my case it returns:
-------------------->8---------------------
$ pkg-config QtCore --variable=moc_location
/usr/lib64/qt4/bin/moc
-------------------->8---------------------

If we do want to use "qmake" directly we may first find it similarly:

-------------------->8---------------------
$ pkg-config QtCore --variable=exec_prefix
/usr/lib64/qt4
-------------------->8---------------------

And then add "/bin/qmake" like this:
-------------------->8---------------------
qmake="\$$(shell pkg-config QtCore --variable=exec_prefix""/bin/qmake";
-------------------->8---------------------

Regards,
Alexey

Thiago Macieira

unread,
Nov 1, 2015, 10:30:06 PM11/1/15
to
On Saturday 31 October 2015 12:39:21 Alexey Brodkin wrote:
> Hi Thiago,
>
> I noticed that with your patch "Update the buildsystem for KConfig finding
> Qt"
> I cannot use "make xconfig" in Fedora 22 any longer.

Hello Alexey

> The reason why xconfig target fails is in Fedora (at least its recent
> versions)
> there's no "qmake". Instead there're "qmake-qt4" and/or
> "qmake-qt5" depending on which Qt packages are installed.

Hmm... you're right. There's no check for a program with a different name in
the new Makefile. I apologise, I never tested that case.

Fedora is knowingly deviating from Qt Project recommendations. I will fix
this, but please file a bug report against their Qt packages so there's some
pressure to adopt a standard solution that everyone else already does.

> But IMHO it would be really nice if we don't break things that used to
> work.

Right. Can you try the attached patch to see if it solves the problem for you?

--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
0001-Attempt-to-find-qmake-qt5-and-qmake-qt4-if-no-qmake-.patch

Michal Marek

unread,
Nov 2, 2015, 5:40:05 AM11/2/15
to
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.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Thiago Macieira

unread,
Nov 2, 2015, 8:50:07 AM11/2/15
to
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.
0001-Use-pkg-config-to-find-Qt-4-and-5-instead-of-direct-.patch

Michal Marek

unread,
Nov 2, 2015, 11:00:07 AM11/2/15
to
On Mon, Nov 02, 2015 at 08:46:55AM -0500, Thiago Macieira wrote:
> 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.

Works for me on openSUSE, it just started to prefer Qt5 now. But it
correctly builds against Qt4 if Qt5 is not available.

Thiago Macieira

unread,
Nov 2, 2015, 11:10:09 AM11/2/15
to
On Monday 02 November 2015 16:50:33 Michal Marek wrote:
> On Mon, Nov 02, 2015 at 08:46:55AM -0500, Thiago Macieira wrote:
> > 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.
>
> Works for me on openSUSE, it just started to prefer Qt5 now. But it
> correctly builds against Qt4 if Qt5 is not available.

That's a consequence of using pkg-config. Now you can no longer choose your
preferred Qt version by setting QT_SELECT, like the qmake solution would have
allowed, as recommended by the Qt Project. At least, the qtchooser shell
function extension does set PKG_CONFIG_PATH, so if you install a different
version elsewhere, that version should be picked up.

It would have been the same with CMake too, btw.

Alexey, did this solve the problem for you?
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center

Michal Marek

unread,
Nov 2, 2015, 11:10:10 AM11/2/15
to
On 2015-11-02 17:01, Thiago Macieira wrote:
> On Monday 02 November 2015 16:50:33 Michal Marek wrote:
>> On Mon, Nov 02, 2015 at 08:46:55AM -0500, Thiago Macieira wrote:
>>> 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.
>>
>> Works for me on openSUSE, it just started to prefer Qt5 now. But it
>> correctly builds against Qt4 if Qt5 is not available.
>
> That's a consequence of using pkg-config. Now you can no longer choose your
> preferred Qt version by setting QT_SELECT, like the qmake solution would have
> allowed, as recommended by the Qt Project.

Yeah, but I think this is acceptable for an application like qconf. Use
best effort to build against some Qt version to let the user configure
their kernel.

Michal

Alexey Brodkin

unread,
Nov 2, 2015, 11:30:10 AM11/2/15
to
Hi Thiago,

On Mon, 2015-11-02 at 11:01 -0500, Thiago Macieira wrote:
> On Monday 02 November 2015 16:50:33 Michal Marek wrote:
> > On Mon, Nov 02, 2015 at 08:46:55AM -0500, Thiago Macieira wrote:
> > > 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.
> >
> > Works for me on openSUSE, it just started to prefer Qt5 now. But it
> > correctly builds against Qt4 if Qt5 is not available.
>
> That's a consequence of using pkg-config. Now you can no longer choose your
> preferred Qt version by setting QT_SELECT, like the qmake solution would have
> allowed, as recommended by the Qt Project. At least, the qtchooser shell
> function extension does set PKG_CONFIG_PATH, so if you install a different
> version elsewhere, that version should be picked up.
>
> It would have been the same with CMake too, btw.
>
> Alexey, did this solve the problem for you?

Yep, thanks a lot.
"make xconfig" now works for me!

-Alexey

Michal Marek

unread,
Nov 2, 2015, 3:40:09 PM11/2/15
to
Dne 2.11.2015 v 17:28 Alexey Brodkin napsal(a):
Thanks for testing, I will apply it to kbuild.git#kconfig.

Thanks,
Michal

Alexey Brodkin

unread,
Nov 2, 2015, 3:50:08 PM11/2/15
to
Hi Michal,

On Mon, 2015-11-02 at 21:38 +0100, Michal Marek wrote:
> Dne 2.11.2015 v 17:28 Alexey Brodkin napsal(a):
> > On Mon, 2015-11-02 at 11:01 -0500, Thiago Macieira wrote:
> > > Alexey, did this solve the problem for you?
> >
> > Yep, thanks a lot.
> > "make xconfig" now works for me!
>
> Thanks for testing, I will apply it to kbuild.git#kconfig.

Thank you for doing this.

Feel free to add "Acked-by: Alexey Brodkin <abro...@synopsys.com>"

-Alexey
0 new messages