Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
On Friday 16 October 2015 06:12:41 Stefan Lippers-Hollmann wrote: > > + @set -e; $(kecho) " CHECK qt"; \ > > + qtver=`qmake -query QT_VERSION` || { \ > > + echo >&2 "*"; \ > > + echo >&2 "* qmake failed."; \ > > + echo >&2 "*"; \ > > + exit 1; \ > > + }; \ > > [...] > > "qmake -query QT_VERSION" appears to be a little fragile on Debian > with both qt4-qmake and qt5-qmake installed, as it reports back > "4.8.7" by default. The actual qmake is hiding behind qtchooser > (/usr/bin/qmake -> qtchooser) and will report different environments > based on the chosen personality: Since xconfig still builds with Qt 4, I didn't feel the need to force the choice for Qt 5. If your environment is qtchooser, then you can just set QT_SELECT=5 before running "make xconfig". -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
On 2015-10-16 06:12, Stefan Lippers-Hollmann wrote: > Hi > > On 2015-09-22, Thiago Macieira wrote: >> The buildsystem will now only search for Qt 4 and Qt 5. Support for Qt 2 >> and 3 was dropped in the previous commits (Qt 3 was EOL'ed in 2010 or >> so...). >> >> For Qt 5, to be future-proof with the future direction notice appearing >> in the 5.5 release, C++11 support is automatically enabled. > [...] >> --- a/scripts/kconfig/Makefile >> +++ b/scripts/kconfig/Makefile > [...] >> +@set -e; $(kecho) " CHECK qt"; \ >> +qtver=`qmake -query QT_VERSION` || { \ >> +echo >&2 "*"; \ >> +echo >&2 "* qmake failed."; \ >> +echo >&2 "*"; \ >> +exit 1; \ >> +}; \ > [...] > > "qmake -query QT_VERSION" appears to be a little fragile on Debian > with both qt4-qmake and qt5-qmake installed, as it reports back > "4.8.7" by default. On openSUSE, I had to change qmake and moc to qmake-qt5 and moc-qt5, respectively. But I don't think that it is a reason to call it fragile. make xconfig works fine if qmake defaults to Qt4 (which seems to be the predominant choice nowadays), but it will continue work once distributions start preferring Qt5. I don't think users have such strong preference as to which Qt version to build against. In the end, it's a simple application with three windows and some buttons. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
On 2015-10-16 06:12, Stefan Lippers-Hollmann wrote: > Hi > > On 2015-09-22, Thiago Macieira wrote: >> The buildsystem will now only search for Qt 4 and Qt 5. Support for Qt 2 >> and 3 was dropped in the previous commits (Qt 3 was EOL'ed in 2010 or >> so...). >> >> For Qt 5, to be future-proof with the future direction notice appearing >> in the 5.5 release, C++11 support is automatically enabled. > [...] >> --- a/scripts/kconfig/Makefile >> +++ b/scripts/kconfig/Makefile > [...] >> +@set -e; $(kecho) " CHECK qt"; \ >> +qtver=`qmake -query QT_VERSION` || { \ >> +echo >&2 "*"; \ >> +echo >&2 "* qmake failed."; \ >> +echo >&2 "*"; \ >> +exit 1; \ >> +}; \ > [...] > > "qmake -query QT_VERSION" appears to be a little fragile on Debian > with both qt4-qmake and qt5-qmake installed, as it reports back > "4.8.7" by default. On openSUSE, I had to change qmake and moc to qmake-qt5 and moc-qt5, respectively. But I don't think that it is a reason to call it fragile. make xconfig works fine if qmake defaults to Qt4 (which seems to be the predominant choice nowadays), but it will continue work once distributions start preferring Qt5. I don't think users have such strong preference as to which Qt version to build against. In the end, it's a simple application with three windows and some buttons. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
On Friday 16 October 2015 06:12:41 Stefan Lippers-Hollmann wrote: > > + @set -e; $(kecho) " CHECK qt"; \ > > + qtver=`qmake -query QT_VERSION` || { \ > > + echo >&2 "*"; \ > > + echo >&2 "* qmake failed."; \ > > + echo >&2 "*"; \ > > + exit 1; \ > > + }; \ > > [...] > > "qmake -query QT_VERSION" appears to be a little fragile on Debian > with both qt4-qmake and qt5-qmake installed, as it reports back > "4.8.7" by default. The actual qmake is hiding behind qtchooser > (/usr/bin/qmake -> qtchooser) and will report different environments > based on the chosen personality: Since xconfig still builds with Qt 4, I didn't feel the need to force the choice for Qt 5. If your environment is qtchooser, then you can just set QT_SELECT=5 before running "make xconfig". -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
Hi On 2015-10-16, Stefan Lippers-Hollmann wrote: > On 2015-09-22, Thiago Macieira wrote: [...] > + QT_SELECT=5 qmake -query QT_VERSION >/dev/null 2>&1 && export > QT_SELECT=5 ||: ; \ Apparently this fails if qmake isn't guarded by qtchooser, but the following should work (although I'm still not confident if that would be the best approach): --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -227,6 +227,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # Qt needs some extra effort... $(obj)/.tmp_qtcheck: @set -e; $(kecho) " CHECK qt"; \ + qtchooser --list-versions | grep -q ^5$ && export QT_SELECT=5 ||: ; \ qtver=`qmake -query QT_VERSION` || { \ echo >&2 "*"; \ echo >&2 "* qmake failed."; \ Regards Stefan Lippers-Hollmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
Hi On 2015-09-22, Thiago Macieira wrote: > The buildsystem will now only search for Qt 4 and Qt 5. Support for Qt 2 > and 3 was dropped in the previous commits (Qt 3 was EOL'ed in 2010 or > so...). > > For Qt 5, to be future-proof with the future direction notice appearing > in the 5.5 release, C++11 support is automatically enabled. [...] > --- a/scripts/kconfig/Makefile > +++ b/scripts/kconfig/Makefile [...] > + @set -e; $(kecho) " CHECK qt"; \ > + qtver=`qmake -query QT_VERSION` || { \ > + echo >&2 "*"; \ > + echo >&2 "* qmake failed."; \ > + echo >&2 "*"; \ > + exit 1; \ > + }; \ [...] "qmake -query QT_VERSION" appears to be a little fragile on Debian with both qt4-qmake and qt5-qmake installed, as it reports back "4.8.7" by default. The actual qmake is hiding behind qtchooser (/usr/bin/qmake -> qtchooser) and will report different environments based on the chosen personality: $ qmake -query QT_VERSION 4.8.7 $ QT_SELECT=5 qmake -query QT_VERSION 5.4.2 While I'm not quite sure what would be the best kind of test here (and if qtchooser can be commonly expected), the following might provide another approach to query the most recent installed qt version: $ qtchooser --list-versions | grep ^[0-9]*$ | sort | tac | head -n1 5 (and then exporting QT_SELECT=5 to the rest of the build). Another approach which appears to work for me (with both qt4 and qt5) would be this, but I'm not quite sure if this would be a good solution: --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -227,6 +227,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # Qt needs some extra effort... $(obj)/.tmp_qtcheck: @set -e; $(kecho) " CHECK qt"; \ + QT_SELECT=5 qmake -query QT_VERSION >/dev/null 2>&1 && export QT_SELECT=5 ||: ; \ qtver=`qmake -query QT_VERSION` || { \ echo >&2 "*"; \ echo >&2 "* qmake failed."; \ Regards Stefan Lippers-Hollmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
Hi On 2015-09-22, Thiago Macieira wrote: > The buildsystem will now only search for Qt 4 and Qt 5. Support for Qt 2 > and 3 was dropped in the previous commits (Qt 3 was EOL'ed in 2010 or > so...). > > For Qt 5, to be future-proof with the future direction notice appearing > in the 5.5 release, C++11 support is automatically enabled. [...] > --- a/scripts/kconfig/Makefile > +++ b/scripts/kconfig/Makefile [...] > + @set -e; $(kecho) " CHECK qt"; \ > + qtver=`qmake -query QT_VERSION` || { \ > + echo >&2 "*"; \ > + echo >&2 "* qmake failed."; \ > + echo >&2 "*"; \ > + exit 1; \ > + }; \ [...] "qmake -query QT_VERSION" appears to be a little fragile on Debian with both qt4-qmake and qt5-qmake installed, as it reports back "4.8.7" by default. The actual qmake is hiding behind qtchooser (/usr/bin/qmake -> qtchooser) and will report different environments based on the chosen personality: $ qmake -query QT_VERSION 4.8.7 $ QT_SELECT=5 qmake -query QT_VERSION 5.4.2 While I'm not quite sure what would be the best kind of test here (and if qtchooser can be commonly expected), the following might provide another approach to query the most recent installed qt version: $ qtchooser --list-versions | grep ^[0-9]*$ | sort | tac | head -n1 5 (and then exporting QT_SELECT=5 to the rest of the build). Another approach which appears to work for me (with both qt4 and qt5) would be this, but I'm not quite sure if this would be a good solution: --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -227,6 +227,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # Qt needs some extra effort... $(obj)/.tmp_qtcheck: @set -e; $(kecho) " CHECK qt"; \ + QT_SELECT=5 qmake -query QT_VERSION >/dev/null 2>&1 && export QT_SELECT=5 ||: ; \ qtver=`qmake -query QT_VERSION` || { \ echo >&2 "*"; \ echo >&2 "* qmake failed."; \ Regards Stefan Lippers-Hollmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
Hi On 2015-10-16, Stefan Lippers-Hollmann wrote: > On 2015-09-22, Thiago Macieira wrote: [...] > + QT_SELECT=5 qmake -query QT_VERSION >/dev/null 2>&1 && export > QT_SELECT=5 ||: ; \ Apparently this fails if qmake isn't guarded by qtchooser, but the following should work (although I'm still not confident if that would be the best approach): --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -227,6 +227,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # Qt needs some extra effort... $(obj)/.tmp_qtcheck: @set -e; $(kecho) " CHECK qt"; \ + qtchooser --list-versions | grep -q ^5$ && export QT_SELECT=5 ||: ; \ qtver=`qmake -query QT_VERSION` || { \ echo >&2 "*"; \ echo >&2 "* qmake failed."; \ Regards Stefan Lippers-Hollmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 39/39] Update the buildsystem for KConfig finding Qt
The buildsystem will now only search for Qt 4 and Qt 5. Support for Qt 2 and 3 was dropped in the previous commits (Qt 3 was EOL'ed in 2010 or so...). For Qt 5, to be future-proof with the future direction notice appearing in the 5.5 release, C++11 support is automatically enabled. Signed-off-by: Thiago Macieira --- scripts/kconfig/Makefile | 73 +++- 1 file changed, 28 insertions(+), 45 deletions(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 9b5b8c6..33c4994 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -226,53 +226,36 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # Qt needs some extra effort... $(obj)/.tmp_qtcheck: - @set -e; $(kecho) " CHECK qt"; dir=""; pkg=""; \ - if ! pkg-config --exists QtCore 2> /dev/null; then \ - echo "* Unable to find the Qt4 tool qmake. Trying to use Qt3"; \ - pkg-config --exists qt 2> /dev/null && pkg=qt; \ - pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ - if [ -n "$$pkg" ]; then \ - cflags="\$$(shell pkg-config $$pkg --cflags)"; \ - libs="\$$(shell pkg-config $$pkg --libs)"; \ - moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ - dir="$$(pkg-config $$pkg --variable=prefix)"; \ - else \ - for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ - if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ - done; \ - if [ -z "$$dir" ]; then \ - echo >&2 "*"; \ - echo >&2 "* Unable to find any Qt installation. Please make sure that"; \ - echo >&2 "* the Qt4 or Qt3 development package is correctly installed and"; \ - echo >&2 "* either qmake can be found or install pkg-config or set"; \ - echo >&2 "* the QTDIR environment variable to the correct location."; \ - echo >&2 "*"; \ - false; \ - fi; \ - libpath=$$dir/lib; lib=qt; osdir=""; \ - $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ - osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ - test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ - test -f $$libpath/libqt-mt.so && lib=qt-mt; \ - cflags="-I$$dir/include"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ - moc="$$dir/bin/moc"; \ - fi; \ - if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ - echo "*"; \ - echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ - echo "*"; \ - moc="/usr/bin/moc"; \ - fi; \ - else \ - cflags="\$$(shell pkg-config QtCore QtGui --cflags)"; \ - libs="\$$(shell pkg-config QtCore QtGui --libs)"; \ - moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \ - [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \ - fi; \ + @set -e; $(kecho) " CHECK qt"; \ + qtver=`qmake -query QT_VERSION` || { \ + echo >&2 "*"; \ + echo >&2 "* qmake failed."; \ + 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; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ - echo "KC_QT_MOC=$$moc" >> $@ + echo "KC_QT_MOC=$$qtbindir/moc" >> $@ endif $(obj)/gconf.o: $(obj)/.tmp_gtkcheck -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 39/39] Update the buildsystem for KConfig finding Qt
The buildsystem will now only search for Qt 4 and Qt 5. Support for Qt 2 and 3 was dropped in the previous commits (Qt 3 was EOL'ed in 2010 or so...). For Qt 5, to be future-proof with the future direction notice appearing in the 5.5 release, C++11 support is automatically enabled. Signed-off-by: Thiago Macieira--- scripts/kconfig/Makefile | 73 +++- 1 file changed, 28 insertions(+), 45 deletions(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 9b5b8c6..33c4994 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -226,53 +226,36 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # Qt needs some extra effort... $(obj)/.tmp_qtcheck: - @set -e; $(kecho) " CHECK qt"; dir=""; pkg=""; \ - if ! pkg-config --exists QtCore 2> /dev/null; then \ - echo "* Unable to find the Qt4 tool qmake. Trying to use Qt3"; \ - pkg-config --exists qt 2> /dev/null && pkg=qt; \ - pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ - if [ -n "$$pkg" ]; then \ - cflags="\$$(shell pkg-config $$pkg --cflags)"; \ - libs="\$$(shell pkg-config $$pkg --libs)"; \ - moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ - dir="$$(pkg-config $$pkg --variable=prefix)"; \ - else \ - for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ - if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ - done; \ - if [ -z "$$dir" ]; then \ - echo >&2 "*"; \ - echo >&2 "* Unable to find any Qt installation. Please make sure that"; \ - echo >&2 "* the Qt4 or Qt3 development package is correctly installed and"; \ - echo >&2 "* either qmake can be found or install pkg-config or set"; \ - echo >&2 "* the QTDIR environment variable to the correct location."; \ - echo >&2 "*"; \ - false; \ - fi; \ - libpath=$$dir/lib; lib=qt; osdir=""; \ - $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ - osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ - test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ - test -f $$libpath/libqt-mt.so && lib=qt-mt; \ - cflags="-I$$dir/include"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ - moc="$$dir/bin/moc"; \ - fi; \ - if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ - echo "*"; \ - echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ - echo "*"; \ - moc="/usr/bin/moc"; \ - fi; \ - else \ - cflags="\$$(shell pkg-config QtCore QtGui --cflags)"; \ - libs="\$$(shell pkg-config QtCore QtGui --libs)"; \ - moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \ - [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \ - fi; \ + @set -e; $(kecho) " CHECK qt"; \ + qtver=`qmake -query QT_VERSION` || { \ + echo >&2 "*"; \ + echo >&2 "* qmake failed."; \ + 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; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ - echo "KC_QT_MOC=$$moc" >> $@ + echo "KC_QT_MOC=$$qtbindir/moc" >> $@ endif $(obj)/gconf.o: $(obj)/.tmp_gtkcheck -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/