aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-11-01 22:12:53 -0500
committerMichal Marek <mmarek@suse.com>2015-11-02 15:43:09 -0500
commit588446a84776cfb3ebbc1677c3407d6884878bd6 (patch)
tree7ffa0f60d0191e38806b268272989fec52d6bb7e
parentf6aad2615c8c4ed806e70693adacb6c93f13564a (diff)
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> Reported-by: Alexey Brodkin <abrodkin@synopsys.com> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Michal Marek <mmarek@suse.com>
-rw-r--r--scripts/kconfig/Makefile37
1 files changed, 13 insertions, 24 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 33c49944e1a7..8d0b1ba77242 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -227,35 +227,24 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile
227# Qt needs some extra effort... 227# Qt needs some extra effort...
228$(obj)/.tmp_qtcheck: 228$(obj)/.tmp_qtcheck:
229 @set -e; $(kecho) " CHECK qt"; \ 229 @set -e; $(kecho) " CHECK qt"; \
230 qtver=`qmake -query QT_VERSION` || { \ 230 if pkg-config --exists Qt5Core; then \
231 cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \
232 libs=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \
233 moc=`pkg-config --variable=host_bins Qt5Core`/moc; \
234 elif pkg-config --exists QtCore; then \
235 cflags=`pkg-config --cflags QtCore QtGui`; \
236 libs=`pkg-config --libs QtCore QtGui`; \
237 moc=`pkg-config --variable=moc_location QtCore`; \
238 else \
231 echo >&2 "*"; \ 239 echo >&2 "*"; \
232 echo >&2 "* qmake failed."; \ 240 echo >&2 "* Could not find Qt via pkg-config."; \
241 echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \
233 echo >&2 "*"; \ 242 echo >&2 "*"; \
234 exit 1; \ 243 exit 1; \
235 }; \ 244 fi; \
236 qtlibdir=`qmake -query QT_INSTALL_LIBS`; \
237 qthdrdir=`qmake -query QT_INSTALL_HEADERS`; \
238 qtbindir=`qmake -query QT_INSTALL_BINS`; \
239 cflags="-I$$qthdrdir -I$$qthdrdir/QtCore -I$$qthdrdir/QtGui"; \
240 case "$$qtver" in \
241 5.*) \
242 cflags="$$cflags -I$$qthdrdir/QtWidgets -std=c++11 -fPIC"; \
243 libs="-L$$qtlibdir -lQt5Widgets -lQt5Gui -lQt5Core "; \
244 ;; \
245 4.*) \
246 libs="-L$$qtlibdir -lQtGui -lQtCore"; \
247 ;; \
248 *) \
249 echo >&2 "*"; \
250 echo >&2 "* Found qmake but it is for Qt version $$qtver, which is not supported."; \
251 echo >&2 "* Please install either Qt 4.8 or 5.x."; \
252 echo >&2 "*"; \
253 exit 1; \
254 ;; \
255 esac; \
256 echo "KC_QT_CFLAGS=$$cflags" > $@; \ 245 echo "KC_QT_CFLAGS=$$cflags" > $@; \
257 echo "KC_QT_LIBS=$$libs" >> $@; \ 246 echo "KC_QT_LIBS=$$libs" >> $@; \
258 echo "KC_QT_MOC=$$qtbindir/moc" >> $@ 247 echo "KC_QT_MOC=$$moc" >> $@
259endif 248endif
260 249
261$(obj)/gconf.o: $(obj)/.tmp_gtkcheck 250$(obj)/gconf.o: $(obj)/.tmp_gtkcheck