From patchwork Fri Aug 28 09:46:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= X-Patchwork-Id: 511841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 6BCC514016A for ; Fri, 28 Aug 2015 19:47:06 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9D420A45BB; Fri, 28 Aug 2015 09:47:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4snwwW0qoyaj; Fri, 28 Aug 2015 09:47:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6869FA45A4; Fri, 28 Aug 2015 09:47:04 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id BB4DC1C0E29 for ; Fri, 28 Aug 2015 09:47:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B6A2894B5A for ; Fri, 28 Aug 2015 09:47:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IwYj3cXCqYjN for ; Fri, 28 Aug 2015 09:46:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from authsmtp.register.it (authsmtp72.register.it [195.110.101.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 71EA594B58 for ; Fri, 28 Aug 2015 09:46:58 +0000 (UTC) Received: from rad-ubuntu.home ([2.1.45.99]) by paganini33 with id A9mt1r01428PCii019mwcA; Fri, 28 Aug 2015 11:46:57 +0200 X-Rid: benoit@wsystem.com@2.1.45.99 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= To: buildroot@buildroot.org Date: Fri, 28 Aug 2015 11:46:51 +0200 Message-Id: <1440755211-46875-1-git-send-email-benoit@wsystem.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Subject: [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Building with ccache failed with: Running configuration tests... Failed to process makespec for platform 'devices/linux-buildroot-g++' Project ERROR: Compiler /host/usr/bin/ccache /host/usr/bin/-g++ not found. Check the value of CROSS_COMPILE -device-option Could not read qmake configuration file /build/qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf. Error processing project file: /dev/null This was caused by Buildroot setting this in qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf: QMAKE_CXX = $${BR_CCACHE} $${CROSS_COMPILE}g++ But qt5base-5.5.0/mkspecs/features/device_config.prf expects QMAKE_CXX to be a single valid (absolute or QMAKE_PATH_ENV-relative) path to an existing file, which is not possible if using ccache as above. Add a patch fixing this by testing only the first value in QMAKE_CXX. Signed-off-by: Benoît Thébaudeau --- Changes v1 -> v2: - Use the first value in QMAKE_CXX instead of removing the whole test. --- .../qt5/qt5base/0009-fix-build-with-ccache.patch | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 package/qt5/qt5base/0009-fix-build-with-ccache.patch diff --git a/package/qt5/qt5base/0009-fix-build-with-ccache.patch b/package/qt5/qt5base/0009-fix-build-with-ccache.patch new file mode 100644 index 0000000..896c0ef --- /dev/null +++ b/package/qt5/qt5base/0009-fix-build-with-ccache.patch @@ -0,0 +1,49 @@ +Fix QMAKE_CXX/CROSS_COMPILE verification with ccache + +The use of ccache leads to QMAKE_CXX definitions of the form: + + QMAKE_CXX = $${CCACHE} $${CROSS_COMPILE}g++ + +The previous test required QMAKE_CXX to be a single valid (absolute or +QMAKE_PATH_ENV-relative) path to an existing file, which was not +compatible with definitions of QMAKE_CXX like the one above. + +Fix this by using only the first value in QMAKE_CXX, which usually +points to the compiler executable, or to the ccache executable in the +above case. + +Signed-off-by: Benoît Thébaudeau +--- + mkspecs/features/device_config.prf | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf +index cd3a0cf..eee4ac6 100644 +--- a/mkspecs/features/device_config.prf ++++ b/mkspecs/features/device_config.prf +@@ -19,10 +19,15 @@ defineTest(deviceSanityCheckCompiler) { + else: \ + sfx = + ++ # Build the compiler filename using the first value in QMAKE_CXX in order to ++ # support tools like ccache, which give QMAKE_CXX values of the form: ++ # ccache ++ compiler = $$first(QMAKE_CXX)$$sfx ++ + # Check if the binary exists with an absolute path. Do this check + # before the CROSS_COMPILE empty check below to allow the mkspec + # to derive the compiler path from other device options. +- exists($$QMAKE_CXX$$sfx):return() ++ exists($$compiler):return() + + # Check for possible reasons of failure + # check if CROSS_COMPILE device-option is set +@@ -31,7 +36,7 @@ defineTest(deviceSanityCheckCompiler) { + # Check if QMAKE_CXX points to an executable. + ensurePathEnv() + for (dir, QMAKE_PATH_ENV) { +- exists($$dir/$${QMAKE_CXX}$$sfx): \ ++ exists($$dir/$${compiler}): \ + return() + } +