mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thiago Macieira <thiago.macieira@intel.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Michal Marek <mmarek@suse.com>
Subject: [PATCH 39/39] Update the buildsystem for KConfig finding Qt
Date: Tue, 22 Sep 2015 11:36:39 -0700	[thread overview]
Message-ID: <1442946999-37018-40-git-send-email-thiago.macieira@intel.com> (raw)
In-Reply-To: <1442946999-37018-1-git-send-email-thiago.macieira@intel.com>

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 <thiago.macieira@intel.com>
---
 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


  parent reply	other threads:[~2015-09-22 18:39 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 18:36 Port of [qx]config to Qt 5 Thiago Macieira
2015-09-22 18:36 ` [PATCH 01/39] Remove support for QT3 and older Thiago Macieira
2015-09-22 18:36 ` [PATCH 02/39] Port xconfig to Qt5 - Use QMainWindow, QToolBar Thiago Macieira
2015-09-22 18:36 ` [PATCH 03/39] Port xconfig to Qt5 - Use QAction Thiago Macieira
2015-09-22 18:36 ` [PATCH 04/39] Port xconfig to Qt5 - Use QFileDialog Thiago Macieira
2015-09-22 18:36 ` [PATCH 05/39] Port xconfig to Qt5 - Use QList Thiago Macieira
2015-09-22 18:36 ` [PATCH 06/39] Port xconfig to Qt5 - Use QTextBrowser Thiago Macieira
2015-09-22 18:36 ` [PATCH 07/39] Port xconfig to Qt5 - Use QMenu Thiago Macieira
2015-09-22 18:36 ` [PATCH 08/39] Port xconfig to Qt5 - Remove unused #include <q3dragobject.h> Thiago Macieira
2015-09-22 18:36 ` [PATCH 09/39] Port xconfig to Qt5 - Replace Q3VBox with QWidget Thiago Macieira
2015-09-22 18:36 ` [PATCH 10/39] Port xconfig to Qt5 - Fix layout Thiago Macieira
2015-09-22 18:36 ` [PATCH 11/39] Port xconfig to Qt5 - Fix layout margin Thiago Macieira
2015-09-22 18:36 ` [PATCH 12/39] Port xconfig to Qt5 - Update QAction checkable Thiago Macieira
2015-09-22 18:36 ` [PATCH 13/39] Port xconfig to Qt5 - Make single/split/full actions checkable Thiago Macieira
2015-09-22 18:36 ` [PATCH 14/39] Port xconfig to Qt5 - Remove custom ListView classes Thiago Macieira
2015-09-22 18:36 ` [PATCH 15/39] Port xconfig to Qt5 - Fix the code so it compiles with Qt5 Thiago Macieira
2015-09-22 18:36 ` [PATCH 16/39] Port xconfig to Qt5 - update signals Thiago Macieira
2015-09-22 18:36 ` [PATCH 17/39] Port xconfig to Qt5 - Introduce Qt4/5 version of ConfigList and ConfigItem Thiago Macieira
2015-09-22 18:36 ` [PATCH 18/39] Port xconfig to Qt5 - Put back some of the old implementation Thiago Macieira
2015-09-22 18:36 ` [PATCH 19/39] Port xconfig to Qt5 - Put back some of the old implementation(part 2) Thiago Macieira
2015-09-22 18:36 ` [PATCH 20/39] Port xconfig to Qt5 - Remove Qt3Support from Makefile Thiago Macieira
2015-09-22 18:36 ` [PATCH 21/39] Port xconfig to Qt5 - Use correct signal names Thiago Macieira
2015-09-22 18:36 ` [PATCH 22/39] Port xconfig to Qt5 - Set ConfigView object name Thiago Macieira
2015-09-22 18:36 ` [PATCH 23/39] Port xconfig to Qt5 - Quick workaround to bypass app crash at startup Thiago Macieira
2015-09-22 18:36 ` [PATCH 24/39] Port xconfig to Qt5 - Tree widget set column titles Thiago Macieira
2015-09-22 18:36 ` [PATCH 25/39] Port xconfig to Qt5 - Add ConfigItem::nextItem to initializer list Thiago Macieira
2015-09-22 18:36 ` [PATCH 26/39] Port xconfig to Qt5 - Add ConfigList::mode " Thiago Macieira
2015-09-22 18:36 ` [PATCH 27/39] Port xconfig to Qt5 - Remove ConfigList::updateMenuList template Thiago Macieira
2015-09-22 18:36 ` [PATCH 28/39] Add current selection check Thiago Macieira
2015-09-22 18:36 ` [PATCH 29/39] Port xconfig to Qt5 - Disable ConfigList soring Thiago Macieira
2015-09-22 18:36 ` [PATCH 30/39] Port xconfig to Qt5 - Change ConfigItem constructor parent type Thiago Macieira
2015-09-22 18:36 ` [PATCH 31/39] Port xconfig to Qt5 - Add horizontal scrollbar, and scroll per pixel Thiago Macieira
2015-10-14 14:03   ` Michal Marek
2015-09-22 18:36 ` [PATCH 32/39] Port xconfig to Qt5 - Source format Thiago Macieira
2015-09-22 18:36 ` [PATCH 33/39] Port xconfig to Qt5 - Remove some commented code Thiago Macieira
2015-09-22 18:36 ` [PATCH 34/39] Port xconfig to Qt5 - Add(back) lineedit editing Thiago Macieira
2015-09-22 18:36 ` [PATCH 35/39] Port xconfig to Qt5 - Add(back) one click checkbox toggle Thiago Macieira
2015-09-22 18:36 ` [PATCH 36/39] Port xconfig to Qt5 - on Back clicked, deselect old item Thiago Macieira
2015-09-22 18:36 ` [PATCH 37/39] Port xconfig to Qt5 - Fix goParent issue Thiago Macieira
2015-09-22 18:36 ` [PATCH 38/39] Port xconfig to Qt5 - Update copyright Thiago Macieira
2015-09-22 18:36 ` Thiago Macieira [this message]
2015-10-16  4:12   ` [PATCH 39/39] Update the buildsystem for KConfig finding Qt Stefan Lippers-Hollmann
2015-10-16  4:21     ` Stefan Lippers-Hollmann
2015-10-16  9:47     ` Michal Marek
2015-10-16 15:28     ` Thiago Macieira
2015-10-14 14:00 ` Port of [qx]config to Qt 5 Michal Marek

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=1442946999-37018-40-git-send-email-thiago.macieira@intel.com \
    --to=thiago.macieira@intel.com \
    --cc=linux-kbuild@vger.kernel.org \
    --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®