History

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.

Thiago Macieira committed 11 years ago

Commit d1b0dc91 parent b4ff1de1 file · +28 −45Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/Makefile+28−45
@@ -226,53 +226,36 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile · 225 unmodified lines
226 226
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"; dir=""; pkg=""; \229 @set -e; $(kecho) " CHECK qt"; \
230 if ! pkg-config --exists QtCore 2> /dev/null; then \230 qtver=`qmake -query QT_VERSION` || { \
231 echo "* Unable to find the Qt4 tool qmake. Trying to use Qt3"; \231 echo >&2 "*"; \
232 pkg-config --exists qt 2> /dev/null && pkg=qt; \232 echo >&2 "* qmake failed."; \
233 pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \233 echo >&2 "*"; \
234 if [ -n "$$pkg" ]; then \234 exit 1; \
235 cflags="\$$(shell pkg-config $$pkg --cflags)"; \235 }; \
236 libs="\$$(shell pkg-config $$pkg --libs)"; \236 qtlibdir=`qmake -query QT_INSTALL_LIBS`; \
237 moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \237 qthdrdir=`qmake -query QT_INSTALL_HEADERS`; \
238 dir="$$(pkg-config $$pkg --variable=prefix)"; \238 qtbindir=`qmake -query QT_INSTALL_BINS`; \
239 else \239 cflags="-I$$qthdrdir -I$$qthdrdir/QtCore -I$$qthdrdir/QtGui"; \
240 for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \240 case "$$qtver" in \
241 if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \241 5.*) \
242 done; \242 cflags="$$cflags -I$$qthdrdir/QtWidgets -std=c++11 -fPIC"; \
243 if [ -z "$$dir" ]; then \243 libs="-L$$qtlibdir -lQt5Widgets -lQt5Gui -lQt5Core "; \
244 echo >&2 "*"; \244 ;; \
245 echo >&2 "* Unable to find any Qt installation. Please make sure that"; \245 4.*) \
246 echo >&2 "* the Qt4 or Qt3 development package is correctly installed and"; \246 libs="-L$$qtlibdir -lQtGui -lQtCore"; \
247 echo >&2 "* either qmake can be found or install pkg-config or set"; \247 ;; \
248 echo >&2 "* the QTDIR environment variable to the correct location."; \248 *) \
249 echo >&2 "*"; \249 echo >&2 "*"; \
250 false; \250 echo >&2 "* Found qmake but it is for Qt version $$qtver, which is not supported."; \
251 fi; \251 echo >&2 "* Please install either Qt 4.8 or 5.x."; \
252 libpath=$$dir/lib; lib=qt; osdir=""; \252 echo >&2 "*"; \
253 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \253 exit 1; \
254 osdir=x$$($(HOSTCXX) -print-multi-os-directory); \254 ;; \
255 test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \255 esac; \
256 test -f $$libpath/libqt-mt.so && lib=qt-mt; \
257 cflags="-I$$dir/include"; \
258 libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
259 moc="$$dir/bin/moc"; \
260 fi; \
261 if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
262 echo "*"; \
263 echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
264 echo "*"; \
265 moc="/usr/bin/moc"; \
266 fi; \
267 else \
268 cflags="\$$(shell pkg-config QtCore QtGui --cflags)"; \
269 libs="\$$(shell pkg-config QtCore QtGui --libs)"; \
270 moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \
271 [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \
272 fi; \
273 echo "KC_QT_CFLAGS=$$cflags" > $@; \256 echo "KC_QT_CFLAGS=$$cflags" > $@; \
274 echo "KC_QT_LIBS=$$libs" >> $@; \257 echo "KC_QT_LIBS=$$libs" >> $@; \
275 echo "KC_QT_MOC=$$moc" >> $@258 echo "KC_QT_MOC=$$qtbindir/moc" >> $@
276endif259endif
277 260
278$(obj)/gconf.o: $(obj)/.tmp_gtkcheck261$(obj)/gconf.o: $(obj)/.tmp_gtkcheck